public void AddToDirectory_ShouldGetCorrectBoolean() { StreamingContentBase content = new StreamingContentBase(); StreamingContentRepo repository = new StreamingContentRepo(); bool addResult = repository.AddContentToDirectory(content); Assert.IsTrue(addResult); }
public void AddToDirectory_ShouldGetCorrectBoolean() { // Arrange StreamingContent content = new StreamingContent(); StreamingContentRepo repository = new StreamingContentRepo(); // Act bool addResult = repository.AddContentToDirectory(content); // Assert Assert.IsTrue(addResult); }
private void SeedContent() { StreamingContentBase futureWar = new StreamingContentBase( "Future War", "A war in the future", 10.0, Genre.SciFi, MaturityRating.G ); _repo.AddContentToDirectory(futureWar); StreamingContentBase theRoom = new StreamingContentBase( "The Room", "Everyone betrays Johnny", 10.0, Genre.Documentary, MaturityRating.G ); _repo.AddContentToDirectory(theRoom); }
public void GetDirectory_ShouldReturnCorrectCollection() { StreamingContentBase content = new StreamingContentBase(); StreamingContentRepo repo = new StreamingContentRepo(); repo.AddContentToDirectory(content); List <StreamingContentBase> contents = repo.GetContents(); bool directoryHasContent = contents.Contains(content); //Assert Assert.IsTrue(directoryHasContent); }
public void DeleteContent_ShouldDeleteContentCorrectly() { //Arrange StreamingContentRepo repo = new StreamingContentRepo(); StreamingContentBase existingContent = new StreamingContentBase("Jumanji", "Cool", 10, Genre.Action, MaturityRating.PG_13); repo.AddContentToDirectory(existingContent); //Act StreamingContentBase content = repo.GetContentByTitle("Jumanji"); bool didDelete = repo.DeleteExisitingContent(content); //Assert Assert.IsTrue(didDelete); }
public void GetByTitle_ShouldReturnCorrectContent() { //Arrange StreamingContentRepo repo = new StreamingContentRepo(); StreamingContentBase newContent = new StreamingContentBase("Jumanji", "Cool", 10, Genre.Action, MaturityRating.PG_13); repo.AddContentToDirectory(newContent); string title = "Jumanji"; //Act StreamingContentBase searchResult = repo.GetContentByTitle(title); //Assert Assert.AreEqual(searchResult.Title, title); }
public void GetContents_ShouldReturnCorrectCollection() { // Arrange StreamingContent content = new StreamingContent(); StreamingContentRepo repository = new StreamingContentRepo(); repository.AddContentToDirectory(content); // Act List <StreamingContent> contents = repository.GetContents(); bool directoryHasContent = contents.Contains(content); // Assert Assert.IsTrue(directoryHasContent); }
public void UpdateContent_ShouldUpdateContentCorrectly() { //Arrange StreamingContentRepo repo = new StreamingContentRepo(); StreamingContentBase oldContent = new StreamingContentBase("Jumanji", "Cool", 10, Genre.Action, MaturityRating.PG_13); repo.AddContentToDirectory(oldContent); StreamingContentBase newContent = new StreamingContentBase("Jumanji", "It sucks", 7, Genre.Horror, MaturityRating.PG_13); //Act bool didUpdateContent = repo.UpdateExistingContent("Jumanji", newContent); //Assert Assert.IsTrue(didUpdateContent); }
public void Arrange() //This will run at the beginning of all subsequent tests, which will save us some steps { _repo = new StreamingContentRepo(); _content = new StreamingContent("title", "a movie", MaturityRating.PG_13, 3, GenreType.Comedy); _repo.AddContentToDirectory(_content); }