Unit test mistakes corrected

This commit is contained in:
Paul Grimshaw 2014-02-13 23:17:53 +00:00
parent b31f393f65
commit 1ea4e00904
1 changed files with 17 additions and 3 deletions

View File

@ -1432,9 +1432,9 @@ Odd
const string format = @"{{#eq Value _Yesterday}}Yes!{{/eq}}";
Generator generator = compiler.Compile(format);
string actual = generator.Render(new {ViewId = "Yesterday"});
string actual = generator.Render(new {Value = "Yesterday"});
string expected = "Yes!";
Assert.AreEqual(expected, actual, "The context variable was not toggled.");
Assert.AreEqual(expected, actual, "Value field didn't work");
}
[TestMethod]
@ -1444,13 +1444,27 @@ Odd
Generator generator = compiler.Compile(format);
string actual = generator.Render(new { Value = "123.3231" });
string expected = "Yes!";
Assert.AreEqual(expected, actual, "Value field didn't work");
}
[TestMethod]
public void TestCompile_NonEqualNumericValue() {
FormatCompiler compiler = new FormatCompiler();
const string format = @"{{#eq Value _123.3232}}Yes!{{/eq}}";
Generator generator = compiler.Compile(format);
string actual = generator.Render(new { Value = "123.3231" });
string expected = "";
Assert.AreEqual(expected, actual, "The context variable was not toggled.");
Assert.AreEqual(expected, actual, "Value field didn't work");
}
#endregion
}
}