public void AddToDirectory_ShouldGetCorrectBoolean() { CustomerContent content = new CustomerContent(); CustomerContent_Repo repository = new CustomerContent_Repo(); bool addResult = repository.AddContentToDirectory(content); Assert.IsTrue(addResult); }
public void GetDirectory_ShouldReturnCorrectCollection() { CustomerContent content = new CustomerContent(); CustomerContent_Repo repo = new CustomerContent_Repo(); repo.AddContentToDirectory(content); List <CustomerContent> contents = repo.GetContents(); bool directoryHasContent = contents.Contains(content); Assert.IsTrue(directoryHasContent); }
public void GetByTitle_ShouldReturnCorrectContent() { //Arrange CustomerContent_Repo repo = new CustomerContent_Repo(); CustomerContent newContent = new CustomerContent("Toy Story", "Toys come to life", 10, Genre.Action, MaturityRating.PG); repo.AddContentToDirectory(newContent); string title = "Toy Story"; //Act CustomerContent searchResult = repo.GetContentByTitle(title); //Assert Assert.AreEqual(searchResult.Title, title); }
public void DeleteExistingContent_ShouldReturnTrue() { //Arrange CustomerContent_Repo repo = new CustomerContent_Repo(); CustomerContent content = new CustomerContent("Toy Story", "Toys come to life", 10, Genre.Action, MaturityRating.PG); repo.AddContentToDirectory(content); //Act CustomerContent oldcontent = repo.GetContentByTitle("Toy Story"); bool removeResult = repo.DeleteExistingContent(oldcontent); //Assert Assert.IsTrue(removeResult); }
public void UpdateExistingContent_ShouldReturnTrue() { //Arrange CustomerContent_Repo repo = new CustomerContent_Repo(); CustomerContent oldContent = new CustomerContent("Toy Story", "Toys come to life", 10, Genre.Action, MaturityRating.PG); repo.AddContentToDirectory(oldContent); CustomerContent newContent = new CustomerContent("Toy Story", "Toys come to life", 10, Genre.Action, MaturityRating.PG); //Act bool updateResult = repo.UpdateExistingContent("Toy Story", newContent); //Assert Assert.IsTrue(updateResult); }