Esempio n. 1
0
        public void ShouldReturnData()
        {
            //Arrage
            //Act
            var sut = MockDataTableFactory.GetCreateDataTable();

            //Asser
            MockDataTableFactory.CheckDataTable(sut);
        }
        public void ShouldMockThrowIfFillArgumentNull()
        {
            //Arrage
            var sut = new MockDbDataAdapter(MockDataTableFactory.GetCreateDataTable());

            //Act
            Action todo = () => sut.Fill(null);

            //Asser
            todo.Should().Throw <ArgumentNullException>();
        }
        public void MockShouldReturnedOneTable()
        {
            //Arrage
            var sut     = new MockDbDataAdapter(MockDataTableFactory.GetCreateDataTable());
            var dataSet = new DataSet();

            //Act
            sut.Fill(dataSet);

            //Asser
            dataSet.Tables.Should().HaveCount(1);
        }
Esempio n. 4
0
        public void ShouldReturnedMockData()
        {
            //Arrage
            var adapter = new MockDbDataAdapter(MockDataTableFactory.GetCreateDataTable());
            AddressDBDataAdapterRepository sut = new AddressDBDataAdapterRepository(adapter);

            //Act
            var list = sut.GetAddresses();

            //Assert
            list.Should().HaveCount(1, "mert 1 elem került a repoba")
            //.And
            //.Should().Equals(new Address { EMail = GlobalStrings.TestEmailAddress })
            ;
        }
        public void MockShouldReturnedData()
        {
            //Arrage
            var sut     = new MockDbDataAdapter(MockDataTableFactory.GetCreateDataTable());
            var dataSet = new DataSet();

            //Act
            sut.Fill(dataSet);

            //Asser
            dataSet.Tables.Should().HaveCount(1, "Mert egy táblával kell visszatérni");

            var table = dataSet.Tables[0];

            MockDataTableFactory.CheckDataTable(table);
        }