Ejemplo n.º 1
0
        public void Get_WhenTargetNotExists_ExpectedResultNull()
        {
            //Arrange
            var DALStub = new MovieDALStub(_Seed);

            //Act
            var result = DALStub.Get(4);

            //Assert
            Assert.IsNull(result);
        }
Ejemplo n.º 2
0
        public void Get_WhenAllOK_ExpectedResultAreEqual()
        {
            //Arrange
            var DALStub        = new MovieDALStub(_Seed);
            var expectedResult = _Seed[1];

            //Act
            var result = DALStub.Get(2);

            //Assert
            Assert.AreEqual(expectedResult, result);
        }
Ejemplo n.º 3
0
        public void Create_WhenNoExistingMovies_ExpectedResultTrueAreEqual()
        {
            //Arrange
            var DALStub = new MovieDALStub();
            var input   = new MovieModelDAL
            {
                ID         = 4,
                Title      = "MOVIE: the Movie",
                Genre      = "Comedy",
                Director   = "MySelf",
                ImdbRating = 9000,
                Plot       = "This is a movie",
                Rated      = "Insert age here...",
                Year       = 2018
            };

            //Act
            bool test1  = DALStub.Create(input);
            var  result = DALStub.Get(4);

            //Assert
            Assert.IsTrue(test1);
            Assert.AreEqual(input, result);
        }