public void GetDriverInCarShouldReturnNull() { MockRepository repo = new MockRepository(); ITaxiDataRepository sut = repo.StrictMock <Linq2SqlTaxiDataRepository>(); int id = 10; DriverInCar dIC = null; Expect.Call(sut.GetDriverInCar(id)).Return(dIC); repo.ReplayAll(); Assert.Null(sut.GetDriverInCar(id)); repo.VerifyAll(); }
public void GetDriverInCarShouldReturnDriverInCar() { MockRepository repo = new MockRepository(); ITaxiDataRepository sut = repo.StrictMock <Linq2SqlTaxiDataRepository>(); int id = 1; DriverInCar dIC = new DriverInCar(id); dIC.CarId = 3; dIC.DriverId = 3; dIC.Address = "Akademika Glushkova 12A"; dIC.Location = "50.374211, 30.462582"; Expect.Call(sut.GetDriverInCar(id)).Return(dIC); repo.ReplayAll(); Assert.True(dIC.Equals(sut.GetDriverInCar(id))); repo.VerifyAll(); }