public void TestEmpty() { string varName = "varName1"; ArrayDeclarationInjectorItem item = new ArrayDeclarationInjectorItem(varName); string expected = CreateExpected(varName); Assert.AreEqual(expected, item.GetContent(null)); }
public void TestBoolean() { string varName = "varName1"; ArrayDeclarationInjectorItem item = new ArrayDeclarationInjectorItem(varName); item.Add(true); item.Add(false); string expected = CreateExpected(varName, "true", "false"); Assert.AreEqual(expected, item.GetContent(null)); }
public void TestDecimals() { string varName = "varName1"; ArrayDeclarationInjectorItem item = new ArrayDeclarationInjectorItem(varName); item.Add(1.5); item.Add((Single)2.5); item.Add(3.5M); string expected = CreateExpected(varName, "1.5", "2.5", "3.5"); Assert.AreEqual(expected, item.GetContent(null)); }
public void TestCode() { string varName = "varName1"; ArrayDeclarationInjectorItem item = new ArrayDeclarationInjectorItem(varName); item.Add(1.5); item.AddCode("alert('hi')"); item.Add(3.5M); string expected = CreateExpected(varName, "1.5", "alert('hi')", "3.5"); Assert.AreEqual(expected, item.GetContent(null)); }
public void TestStrings() { string varName = "varName1"; ArrayDeclarationInjectorItem item = new ArrayDeclarationInjectorItem(varName); item.Add("abc"); item.Add("ab\"c"); item.Add("abc<hi>"); item.Add("abc<hi>", false); string expected = CreateExpected(varName, "\"abc\"", "\"ab"c\"", "\"abc<hi>\"", "\"abc<hi>\""); Assert.AreEqual(expected, item.GetContent(null)); }
public void TestInts() { string varName = "varName1"; ArrayDeclarationInjectorItem item = new ArrayDeclarationInjectorItem(varName); item.Add(1); item.Add((short)2); item.Add((long)3); string expected = CreateExpected(varName, "1", "2", "3"); Assert.AreEqual(expected, item.GetContent(null)); }