Ejemplo n.º 1
0
        public void TestMoreThanOneTable()
        {
            SimpleFixture fixture = new SimpleFixture();

            fixture.LoadData("|some|\n|column|\n|50|\n\n|other table|\n|other|\n|45|\n\n");

            Table table      = fixture.GetTable("some");
            Table otherTable = fixture.GetTable("other table");

            Assert.AreEqual(2, fixture.TablesCount());
            Assert.AreEqual(1, table.RowsCount());
            Assert.AreEqual(1, otherTable.RowsCount());
        }
Ejemplo n.º 2
0
        public void TestShouldReadExampleFromString()
        {
            SimpleFixture fixture = new SimpleFixture();

            fixture.LoadData("|some|\n|column|\n|50|\n\n");

            Table table = fixture.GetTable("some");

            Assert.AreEqual(1, table.RowsCount());
        }
Ejemplo n.º 3
0
        public void TestGetTableShouldThrowIfThereIsMoreThanOneTableWithTheSameName()
        {
            SimpleFixture fixture = new SimpleFixture();

            fixture.LoadData("|TableWithArgs|someArg|\n|field1|field2|\n|1.74|73|\n\n|TableWithArgs|otherArg|\n|field1|field2|\n|474|21|\n\n");

            try {
                fixture.GetTable("TableWithArgs");
                Assert.Fail("should throw an exception here");
            } catch (Exception e) {}
        }