Esempio n. 1
0
        public void AddToDirectory_ShouldGetCorrectBoolean()
        {
            CustomerContent      content    = new CustomerContent();
            CustomerContent_Repo repository = new CustomerContent_Repo();

            bool addResult = repository.AddContentToDirectory(content);

            Assert.IsTrue(addResult);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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);
        }