Exemplo n.º 1
0
        public void DoTable(Fixture fixture, Parse tables, object[] businessObjects, int right, int wrong, int ignores, int exceptions)
        {
            BusinessObjectRowFixture.objects = businessObjects;
            RunTest(fixture, tables);

            TestUtils.CheckCounts(resultCounts, right, wrong, ignores, exceptions);
        }
Exemplo n.º 2
0
        public void TestMissing()
        {
            TestUtils.InitAssembliesAndNamespaces();
            var builder = new TestBuilder();

            builder.Append("<table>");
            builder.Append("<tr><td>BusinessObjectRowFixture</td></tr>");
            builder.Append("<tr><td>GetFirstString</td></tr>");
            builder.Append("<tr><td>number1</td></tr>");
            builder.Append("<tr><td>number2</td></tr>");
            builder.Append("<tr><td>number3</td></tr>");
            builder.Append("</table>");
            var parse = builder.Parse;

            BusinessObjectRowFixture.objects = new object[]
            {
                new BusinessObject(new[] { "number1" }),
            };

            RunTest(new BusinessObjectRowFixture(), parse);
            Assert.IsTrue(parse.ToString().IndexOf("number1") > 0);
            Assert.IsTrue(parse.ToString().IndexOf("number2") > 0);
            Assert.IsTrue(parse.ToString().IndexOf("number3") > 0);
            TestUtils.CheckCounts(resultCounts, 1, 2, 0, 0);
        }
Exemplo n.º 3
0
        public void TestEmptyHeaderCell()
        {
            TestUtils.InitAssembliesAndNamespaces();
            var builder = new TestBuilder();

            builder.Append("<table>");
            builder.Append("<tr><td colspan=\"2\">string fixture</td></tr>");
            builder.Append("<tr><td>field</td><td></td></tr>");
            builder.Append("<tr><td>some value</td><td>this is a comment</td></tr>");
            builder.Append("</table>");
            var table = builder.Parse;

            RunTest(new StringFixture(), table);
            TestUtils.CheckCounts(resultCounts, 0, 0, 0, 0);
        }
Exemplo n.º 4
0
        public void TestBlankCell()
        {
            var builder = new TestBuilder();

            builder.Append("<table>");
            builder.Append("<tr><td colspan=\"6\">string fixture</td></tr>");
            builder.Append("<tr><td>field</td><td>field?</td><td>property</td><td>property?</td><td>set</td><td>get?</td></tr>");
            builder.Append("<tr><td>blank</td><td>blank</td><td>blank</td><td>blank</td><td>blank</td><td>blank</td></tr>");
            builder.Append("</table>");

            var parse = builder.Parse;

            TestUtils.InitAssembliesAndNamespaces();
            RunTest(new StringFixture(), parse);
            TestUtils.CheckCounts(resultCounts, 3, 0, 0, 0);
        }
Exemplo n.º 5
0
        public void TestNullCell()
        {
            var builder = new TestBuilder();

            builder.Append("<table>");
            builder.Append("<tr><td colspan=\"2\">string fixture</td></tr>");
            builder.Append("<tr><td>Field</td><td>Field?</td></tr>");
            builder.Append("<tr><td></td><td>null</td></tr>");
            builder.Append("</table>");

            var parse = builder.Parse;

            TestUtils.InitAssembliesAndNamespaces();
            RunTest(new StringFixture(), parse);
            TestUtils.CheckCounts(resultCounts, 1, 0, 0, 0);
        }
Exemplo n.º 6
0
        public void TestStartsWithHandlerInSecondColumn()
        {
            processor.AddOperator(typeof(CompareStartsWith).FullName);
            var builder = new TestBuilder();

            builder.Append("<table>");
            builder.Append("<tr><td>people row fixture</td></tr>");
            builder.Append("<tr><td>first name</td><td>last name</td></tr>");
            builder.Append("<tr><td>Nigel</td><td>Tuf..</td></tr>");
            builder.Append("</table>");
            PeopleLoaderFixture.people.Clear();
            PeopleLoaderFixture.people.Add(new Person("Nigel", "Tufnel"));
            var tables = builder.Parse;

            RunTest(new PeopleRowFixture(), tables);
            Assert.IsTrue(tables.ToString().IndexOf("Tuf..") > -1);
            Assert.IsFalse(tables.ToString().IndexOf("Tufnel") > -1);
            TestUtils.CheckCounts(resultCounts, 2, 0, 0, 0);
        }
Exemplo n.º 7
0
 void VerifyCounts(int right, int wrong, int exceptions, int ignores)
 {
     TestUtils.CheckCounts(resultCounts, right, wrong, exceptions, ignores);
 }