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

            //Act
            bool test = DALStub.Delete(4);

            //Assert
            Assert.IsFalse(test);
        }
Beispiel #2
0
        public void Delete_WhenOneOrderExsists_ExpectedResultCount0()
        {
            //Arrange
            var movieList = new List <MovieModelDAL> {
                _ExampleMovie
            };
            var initialOrders = _SeedOrders(movieList, _SeedUser);
            var DALStub       = new MovieOrderDALStub(initialOrders);

            //Act
            bool test1  = DALStub.Delete(1);
            var  result = DALStub.GetAll();

            //Assert
            Assert.IsTrue(test1);
            Assert.IsTrue(result.Count == 0);
        }
Beispiel #3
0
        public void Delete_WhenThreeOrdersExsists_ExpectedResultCount2()
        {
            //Arrange
            var initialOrders  = _SeedOrders(_SeedMovies, _SeedUser);
            var DALStub        = new MovieOrderDALStub(initialOrders);
            var expectedResult = new List <MovieOrderModelDAL>
            {
                initialOrders[0], initialOrders[2]
            };

            //Act
            bool test1  = DALStub.Delete(2);
            var  result = DALStub.GetAll();

            //Assert
            Assert.IsTrue(test1);
            Assert.IsTrue(result.Count == 2);
            for (int i = 0; i < result.Count; i++)
            {
                Assert.AreEqual(expectedResult[i].ID, result[i].ID);
                Assert.AreEqual(expectedResult[i].RentedMovieId, result[i].RentedMovieId);
            }
        }