public void ShouldInsertWhenPreferenceUserRepositoryIsValid() { var entity = FactoryPreferenceUser.RandomCreate(); _spacePlanningUnitOfWork.PreferenceUserRepository.Add(entity); _spacePlanningUnitOfWork.Save(); var retrived = _spacePlanningUnitOfWork.PreferenceUserRepository.GetById(entity.UserId, entity.PreferenceId); Assert.IsTrue(retrived.Equals(entity)); }
public void ShoultDeleteWhenPreferenceUserRepositoryIsValid() { var entity = FactoryPreferenceUser.RandomCreate(); _spacePlanningUnitOfWork.PreferenceUserRepository.Add(entity); _spacePlanningUnitOfWork.Save(); _spacePlanningUnitOfWork.PreferenceUserRepository.Delete(entity); _spacePlanningUnitOfWork.Save(); var retrived = _spacePlanningUnitOfWork.PreferenceUserRepository.GetById(entity.PreferenceId, entity.UserId); Assert.IsNull(retrived); }