示例#1
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
        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);
        }
示例#7
0
        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);
 }