public void GetDriverShouldReturnNull() { MockRepository repo = new MockRepository(); ITaxiDataRepository sut = repo.StrictMock <Linq2SqlTaxiDataRepository>(); int id = 10; Driver driver = null; Expect.Call(sut.GetDriver(id)).Return(driver); repo.ReplayAll(); Assert.Null(sut.GetDriver(id)); repo.VerifyAll(); }
public void GetDriverShouldReturnDriver() { MockRepository repo = new MockRepository(); ITaxiDataRepository sut = repo.StrictMock <Linq2SqlTaxiDataRepository>(); int id = 1; Driver driver = new Driver(id); driver.FirstName = "Oleksandr"; driver.LastName = "Sidorov"; driver.HomeAddress = "Peremogy, 50"; driver.PhoneNumber = "0507854312"; Expect.Call(sut.GetDriver(id)).Return(driver); repo.ReplayAll(); Assert.True(driver.Equals(sut.GetDriver(id))); repo.VerifyAll(); }