public void SaveTest() { librarianRepository.Save(librarian1); Assert.AreEqual(librarianRepository.GetItems().Count(), countItems + 1); librarianRepository.Save(librarian2); Assert.AreEqual(librarianRepository.GetItems().Count(), countItems + 2); librarianRepository.Save(librarian2); Assert.AreEqual(librarianRepository.GetItems().Count(), countItems + 2); librarianRepository.Remove(librarian2); librarianRepository.Remove(librarian1); }
public LibrarianRepositoryTest() { repositoryFactory = new T(); libraryDepartmentRepository = repositoryFactory.CreateLibraryDepartmentRepository(); librarianRepository = repositoryFactory.CreateLibrarianRepository(libraryDepartmentRepository); countItems = librarianRepository.GetItems().Count(); }
public LibrarianRepositoryTest() { repositoryFactory = new T(); libraryDepartmentRepository = repositoryFactory.CreateLibraryDepartmentRepository(); librarianRepository = repositoryFactory.CreateLibrarianRepository(libraryDepartmentRepository); countItems = librarianRepository.GetItems().Count(); department = new LibraryDepartment("Абонемент", true); librarian1 = new Librarian("John Doe", department); librarian2 = new Librarian("Alex Pupkin", department); }