Permalink
Browse files

Four4Sample - ExpressionTest -> EvalTest

  • Loading branch information...
bobbymcr committed Mar 11, 2018
1 parent c919cee commit 22bcba068daecb59c597bffdbb57b4db6b7fca28
Showing with 13 additions and 13 deletions.
  1. +13 −13 projects/Four4Sample/Four4.Test/{ExpressionTest.cs → EvalTest.cs}
@@ -1,4 +1,4 @@
// <copyright file="ExpressionTest.cs" company="Brian Rogers">
// <copyright file="EvalTest.cs" company="Brian Rogers">
// Copyright (c) Brian Rogers. All rights reserved.
// </copyright>
@@ -7,15 +7,15 @@ namespace Four4.Test
using FluentAssertions;
using Xunit;
public sealed class ExpressionTest
public sealed class EvalTest
{
[Theory]
[InlineData("4", "4")]
[InlineData(".4", "2/5")]
[InlineData(".4_", "4/9")]
public void NumbersWithOne4(string input, string result)
{
TestEval(input, result);
Test(input, result);
}
[Theory]
@@ -25,7 +25,7 @@ public void NumbersWithOne4(string input, string result)
[InlineData("4 4", "NaN")]
public void NumbersWithTwo4s(string input, string result)
{
TestEval(input, result);
Test(input, result);
}
[Theory]
@@ -35,7 +35,7 @@ public void NumbersWithTwo4s(string input, string result)
[InlineData("444", "444")]
public void NumbersWithThree4s(string input, string result)
{
TestEval(input, result);
Test(input, result);
}
[Theory]
@@ -46,7 +46,7 @@ public void NumbersWithThree4s(string input, string result)
[InlineData("4444", "4444")]
public void NumbersWithFour4s(string input, string result)
{
TestEval(input, result);
Test(input, result);
}
[Theory]
@@ -59,7 +59,7 @@ public void NumbersWithFour4s(string input, string result)
[InlineData("4 4 4 +", "NaN")]
public void Addition(string input, string result)
{
TestEval(input, result);
Test(input, result);
}
[Theory]
@@ -76,7 +76,7 @@ public void Addition(string input, string result)
[InlineData("4 4 4 -", "NaN")]
public void Subtraction(string input, string result)
{
TestEval(input, result);
Test(input, result);
}
[Theory]
@@ -91,7 +91,7 @@ public void Subtraction(string input, string result)
[InlineData("4 4 4 *", "NaN")]
public void Multiplication(string input, string result)
{
TestEval(input, result);
Test(input, result);
}
[Theory]
@@ -108,7 +108,7 @@ public void Multiplication(string input, string result)
[InlineData("4 4 4 /", "NaN")]
public void Division(string input, string result)
{
TestEval(input, result);
Test(input, result);
}
[Theory]
@@ -124,7 +124,7 @@ public void Division(string input, string result)
[InlineData("4 4 !", "NaN")]
public void Factorial(string input, string result)
{
TestEval(input, result);
Test(input, result);
}
[Theory]
@@ -142,10 +142,10 @@ public void Factorial(string input, string result)
[InlineData("4 4 R", "NaN")]
public void SquareRoot(string input, string result)
{
TestEval(input, result);
Test(input, result);
}
private static void TestEval(string input, string result)
private static void Test(string input, string result)
{
Expression.Eval(input).ToString().Should().Be(result, "input was {0}", input);
}

0 comments on commit 22bcba0

Please sign in to comment.