public void TestParse_ValidScalarValueWorks() { var actual = new IntMarkupParser().Parse("int", false, "43", null); Assert.AreEqual("43", actual.InitializerString); Assert.AreEqual(43, (int)actual.ValueRetriever()); }
public void TestParse_ValidArrayValuesWork() { var actual = new IntMarkupParser().Parse("int", true, "", null); Assert.AreEqual("new int[] { }", actual.InitializerString); Assert.IsTrue(new int[0].SequenceEqual((int[])actual.ValueRetriever())); actual = new IntMarkupParser().Parse("int", true, "43", null); Assert.AreEqual("new int[] { 43 }", actual.InitializerString); Assert.IsTrue(new int[] { 43 }.SequenceEqual((int[])actual.ValueRetriever())); actual = new IntMarkupParser().Parse("int", true, "43|120|0", null); Assert.AreEqual("new int[] { 43, 120, 0 }", actual.InitializerString); Assert.IsTrue(new int[] { 43, 120, 0 }.SequenceEqual((int[])actual.ValueRetriever())); }