Пример #1
0
 public void ReadData_test()
 {
     ISqlDataReader readerStub = MockRepository.GenerateStub<ISqlDataReader>();
     readerStub.Stub(x => x.Read()).Return(true).Repeat.Twice();
     List<string> result = new SqlDataReaderSample().ReadData(readerStub);
     Assert.AreEqual(2, result.Count);
 }
Пример #2
0
 public void ReadData_test()
 {
     ISqlDataReader readerStub = NSubstitute.Substitute.For<ISqlDataReader>();
     readerStub.Read().Returns(true,true,false);
     List<string> result = new SqlDataReaderSample().ReadData(readerStub);
     readerStub.Received(2);
     Assert.AreEqual(2, result.Count);
 }
Пример #3
0
        public void ReadData_test()
        {
            ISqlDataReader readerStub = NSubstitute.Substitute.For <ISqlDataReader>();

            readerStub.Read().Returns(true, true, false);
            List <string> result = new SqlDataReaderSample().ReadData(readerStub);

            readerStub.Received(2);
            Assert.AreEqual(2, result.Count);
        }