From 1ea4e00904cf61a2d3f7a770293d0d5135483eab Mon Sep 17 00:00:00 2001 From: Paul Grimshaw Date: Thu, 13 Feb 2014 23:17:53 +0000 Subject: [PATCH] Unit test mistakes corrected --- mustache-sharp.test/FormatCompilerTester.cs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/mustache-sharp.test/FormatCompilerTester.cs b/mustache-sharp.test/FormatCompilerTester.cs index f81edc7..a7e25f7 100644 --- a/mustache-sharp.test/FormatCompilerTester.cs +++ b/mustache-sharp.test/FormatCompilerTester.cs @@ -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 + + } }