public void Add_RepoContains1Person_PersonAddedToRepo() { var testObject = new PersonTestableObject(); testObject.InMemoryCarRepository.Save(testObject.PersonJack); Assert.AreEqual(testObject.PersonJack, testObject.InMemoryCarRepository.FindById(testObject.PersonJack.Id)); }
private void CRUDmix() { var testObject = new PersonTestableObject(); testObject.InMemoryCarRepository.Save(testObject.PersonJack); testObject.InMemoryCarRepository.Save(testObject.PersonRobert); testObject.InMemoryCarRepository.Delete(testObject.PersonJack.Id); }
public void PerformDeleteOperation() { var testObject = new PersonTestableObject(); testObject.InMemoryCarRepository.Save(testObject.PersonJack); testObject.InMemoryCarRepository.Save(testObject.PersonRobert); testObject.InMemoryCarRepository.Delete(testObject.PersonJack.Id); }
public void PerformFindOperation() { var testObject = new PersonTestableObject(); testObject.InMemoryCarRepository.Save(testObject.PersonJack); testObject.InMemoryCarRepository.Save(testObject.PersonRobert); var result = testObject.InMemoryCarRepository.FindById(testObject.PersonRobert.Id); }
public void GetAll_Add2PersonsToRepo_RepoAllReturn2Persons() { var testObject = new PersonTestableObject(); testObject.InMemoryCarRepository.Save(testObject.PersonJack); testObject.InMemoryCarRepository.Save(testObject.PersonRobert); Assert.AreEqual(2, testObject.InMemoryCarRepository.All().Count()); Assert.AreEqual(testObject.PersonJack, testObject.InMemoryCarRepository.FindById(testObject.PersonJack.Id)); Assert.AreEqual(testObject.PersonRobert, testObject.InMemoryCarRepository.FindById(testObject.PersonRobert.Id)); }
public void Delete_RepoNotContainsAddedPerson_TargetPersonRemoved() { var testObject = new PersonTestableObject(); testObject.InMemoryCarRepository.Save(testObject.PersonJack); testObject.InMemoryCarRepository.Save(testObject.PersonRobert); testObject.InMemoryCarRepository.Delete(testObject.PersonJack.Id); Assert.IsNull(testObject.InMemoryCarRepository.FindById(testObject.PersonJack.Id)); Assert.AreEqual(1, testObject.InMemoryCarRepository.All().Count()); }
public void Find_RepoContainsAddedPerson_AddedPersonReturned() { var testObject = new PersonTestableObject(); testObject.InMemoryCarRepository.Save(testObject.PersonJack); testObject.InMemoryCarRepository.Save(testObject.PersonRobert); var targetElement = testObject.InMemoryCarRepository.FindById(testObject.PersonJack.Id); var emptyElement = testObject.InMemoryCarRepository.FindById(String.Empty); Assert.NotNull(targetElement); Assert.IsNull(emptyElement); }
public void Update_RepoContainsUpdateCar_UpdatedCarReturned() { var testObject = new PersonTestableObject(); testObject.InMemoryCarRepository.Save(testObject.PersonJack); testObject.InMemoryCarRepository.Save(testObject.PersonRobert); var targetElement = testObject.InMemoryCarRepository.FindById(testObject.PersonJack.Id); var NameOfNewPerson = "Ben"; targetElement.FirstName = NameOfNewPerson; testObject.InMemoryCarRepository.Save(targetElement); Assert.AreEqual(NameOfNewPerson, testObject.InMemoryCarRepository.FindById(testObject.PersonJack.Id).FirstName); }
public void PerformAddOperation() { var testObject = new PersonTestableObject(); testObject.InMemoryCarRepository.Save(testObject.PersonJack); }