Ejemplo n.º 1
0
        public void Seed()
        {
            _repo = new StreamingContent_Repo();
            StreamingContent theRoom = new StreamingContent(
                "The Room",
                "Everyone betrays Johnny and he's fed up with this world",
                Maturity.R,
                5,
                GenreType.Romance
                );
            StreamingContent spaceballs = new StreamingContent(
                "Spaceballs",
                "fun in space",
                Maturity.PG,
                5,
                GenreType.Comedy
                );

            _repo.AddContentToDirectory(theRoom);
            _repo.AddContentToDirectory(spaceballs);

            _content = new StreamingContent(
                "Groundhog Day",
                "Bill Murray gets caught in a time loop for no reason",
                Maturity.PG,
                5,
                GenreType.Drama
                );
            _repo.AddContentToDirectory(_content);
        }
        public void AddToDirectory_ShouldGetCorrectBoolean()
        {
            //Arrange
            StreamingContent      content    = new StreamingContent();
            StreamingContent_Repo repository = new StreamingContent_Repo();
            //Act
            bool addResult = repository.AddContentToDirectory(content);

            //Assert
            Assert.IsTrue(addResult);
        }
Ejemplo n.º 3
0
        public void Seed()
        {
            _repo = new StreamingContent_Repo();
            StreamingContent theRoom = new StreamingContent(
                "The Room",
                "Everyone betrays Johnny and he's feed up with this world",
                Maturity.R,
                5,
                GenreType.Romance
                );
            StreamingContent spaceballs = new StreamingContent(
                "Spaceballs",
                "fun in space",
                Maturity.PG,
                5,
                GenreType.Comedy
                );

            _repo.AddContentToDirectory(theRoom);
            _repo.AddContentToDirectory(spaceballs);


            _content = new StreamingContent(
                "Groundhog Day",
                "Bill Murray gets caught in a time loop for no reason",
                Maturity.PG,
                5,
                GenreType.Drama
                );
            _repo.AddContentToDirectory(_content);


            Show show = new Show();

            show.Title       = "Arrested Development";
            show.SeasonCount = 4;
            Episode ep = new Episode();

            ep.Title = "Courting Disasters";
            Episode ep2 = new Episode();

            ep2.Title = "Pier Pressire";

            _repo.AddContentToDirectory(show);

            Movie movie = new Movie();

            movie.Title       = "Roller Blade";
            movie.Description = "In a world of blood and greed, curvaceous crusafers battle to rebuilt a battered land.";

            _repo.AddContentToDirectory(movie);
        }
        public void AddToDirectory_ShouldGetCorrectBoolean()
        {
            //Arrange– setup the testing objects and prepare the prerequisites for your test.

            StreamingContent      content    = new StreamingContent();
            StreamingContent_Repo repository = new StreamingContent_Repo();

            //Act– perform the actual work of the test.

            bool addResult = repository.AddContentToDirectory(content);

            //Assert– verify the result.
            Assert.IsTrue(addResult);
        }
        public void GetDirectory_ShouldReturnCorrectCollection()
        {
            //Arrange
            StreamingContent      content = new StreamingContent();
            StreamingContent_Repo repo    = new StreamingContent_Repo();

            repo.AddContentToDirectory(content);
            //Act
            List <StreamingContent> contents = repo.GetContents();

            bool directoryHasContent = contents.Contains(content);//checking if contents contains the contents from the directory

            //Assert
            Assert.IsTrue(directoryHasContent);
        }
Ejemplo n.º 6
0
        public void GetByTitle_ShouldReturnCorrectConents()
        {
            //Arrange
            StreamingContent_Repo repo       = new StreamingContent_Repo();
            StreamingContent      newContent = new StreamingContent("Toy Story", "Toys come to life", 10, Genre.Action, MaturityRating.G);

            repo.AddContentToDirectory(newContent);
            string title = "Toy Story";

            //ACT
            StreamingContent searchResult = repo.GetContentByTitle(title);

            //Assert
            Assert.AreEqual(searchResult.Title, title);
        }
Ejemplo n.º 7
0
        public void UpdateExistingContent_ShouldReturnTrue()
        {
            //Arrange
            StreamingContent_Repo repo       = new StreamingContent_Repo();
            StreamingContent      oldContent = new StreamingContent("Toy Story", "Toys come to life", 8, Genre.Documentary, MaturityRating.PG);
            StreamingContent      newContent = new StreamingContent("Toy Story", "Toys come to life", 10, Genre.Action, MaturityRating.G);

            repo.AddContentToDirectory(oldContent);

            // Act

            bool updateResult = repo.UpdateExistingContent(oldContent.Title, newContent);

            //Assert
            Assert.IsTrue(updateResult);
        }
Ejemplo n.º 8
0
        public void DeleteExistingContent_ShouldReturnTrue()
        {
            //Arrange
            StreamingContent_Repo repo    = new StreamingContent_Repo();
            StreamingContent      content = new StreamingContent("Toy Story", "Toys come to life", 8, Genre.Drama, MaturityRating.PG);

            repo.AddContentToDirectory(content);

            //Act
            StreamingContent oldContent = repo.GetContentByTitle("Toy Story");

            bool removeResult = repo.DeleteExistingContent(oldContent);

            //Assert
            Assert.IsTrue(removeResult);
        }