private void DeleteInitialData() { IBoardingRepository boardingRepository = new BoardingRepository(); foreach (var boarding in _boardings) { Boarding fromDb = boardingRepository.GetById(boarding.BoardingId); if (fromDb != null) { boardingRepository.Remove(boarding); } } IUserRepository userRepository = new UserRepository(); userRepository.Remove(_user1); userRepository.Remove(_user2); IDogRepository dogRepository = new DogRepository(); dogRepository.Remove(_dog1); dogRepository.Remove(_dog2); ICostRepository costRepository = new CostRepository(); costRepository.Remove(_boardingCost); costRepository.Remove(_sundayDaycareCost); }
public void Can_get_existing_boarding_by_id() { IBoardingRepository repository = new BoardingRepository(); var fromDb = repository.GetById(_boardings[1].BoardingId); Assert.IsNotNull(fromDb); Assert.AreNotSame(_boardings[1], fromDb); Assert.AreEqual(_boardings[1].Date, fromDb.Date); Assert.AreEqual(_boardings[1].IsDaycare, fromDb.IsDaycare); Assert.AreEqual(_boardings[1].Dog, fromDb.Dog); Assert.AreEqual(_boardings[1].BoardingCost, fromDb.BoardingCost); Assert.AreEqual(_boardings[1].SundayDaycareCost, fromDb.SundayDaycareCost); Assert.AreEqual(_boardings[1].User, fromDb.User); }