Exemplo n.º 1
0
        public void Construct_With_FakeTable_sets_SchemaType_to_DataTable()
        {
            var table = new FakeTable <Person>();

            table.AddRow(new Person {
                Id = 1, Name = "Bob", DateOfBirth = new DateTime(1980, 06, 15)
            });

            var sut = new FakeDataReader(table);

            //Assert.Equal(SchemaDataTypeSource.DataTable, sut.SchemaDataTypeSource);
        }
Exemplo n.º 2
0
        public void AddRowFromInstance_add_row_data_Correctly()
        {
            var row1 = new Person {
                Id = 1, Name = "Bob", DateOfBirth = new DateTime(1980, 06, 15)
            };

            var sut = new FakeTable <Person>();

            sut.AddRow(row1);

            Assert.Equal(1, sut.Rows.Count);
            Assert.Equal(row1.Id, sut.Rows[0]["Id"]);
            Assert.Equal(row1.Name, sut.Rows[0]["Name"]);
            Assert.Equal(row1.DateOfBirth, sut.Rows[0]["DateOfBirth"]);
        }