Exemple #1
0
        public void Get_WhenTargetNotExists_ExpectedResultNull()
        {
            //Arrange
            var initialOrders = _SeedOrders(_SeedMovies, _SeedUser);
            var DALStub       = new MovieOrderDALStub(initialOrders);

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

            //Assert
            Assert.IsNull(result);
        }
Exemple #2
0
        public void Get_WhenAllOK_ExpectedResultTrueAreEqual()
        {
            //Arrange
            var initialOrders  = _SeedOrders(_SeedMovies, _SeedUser);
            var DALStub        = new MovieOrderDALStub(initialOrders);
            var expectedResult = initialOrders[1];

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

            //Assert
            Assert.AreEqual(expectedResult.ID, result.ID);
            Assert.AreEqual(expectedResult.RentedMovieId, result.RentedMovieId);
        }
Exemple #3
0
        public void CreateWhenNoExistingOrders_ExpectedResultTrueAreEqual()
        {
            //Arrange
            var DALStub   = new MovieOrderDALStub();
            var movieList = new List <MovieModelDAL> {
                _ExampleMovie
            };
            var orderList = _SeedOrders(movieList, _ExampleUser);
            var input     = orderList[0];

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

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