Exemplo n.º 1
0
        public void DeleteTourTestWithException()
        {
            ResetData();
            var         uow = new Mock <UnitOfWork>();
            TourService ts  = new TourService(uow.Object);

            ts.DeleteTour(-5);
        }
Exemplo n.º 2
0
        public void Test_DeleteTour()
        {
            Tour tour = (Tour)_tourList[0];

            _tourDalMock.Setup(s => s.DeleteTour(tour));

            _tourService.DeleteTour(tour);

            _tourDalMock.Verify(s => s.DeleteTour(tour), Times.Once);
        }
Exemplo n.º 3
0
        public void DeleteTourTest()
        {
            ResetData();
            var               uow = new Mock <UnitOfWork>();
            TourService       ts  = new TourService(uow.Object);
            OutputTourService ots = new OutputTourService(uow.Object);

            TourDTO tour = new TourDTO()
            {
                Country = "Test", Hotel = "Test", Region = "Test", EndDate = DateTime.Now, StartDate = DateTime.Now
            };

            ts.CreateTour(tour);
            List <TourDTO> tours = ots.GetAllFilteredTours(null, null, null, false);
            int            numEx = tours.Count - 1;

            ts.DeleteTour(tours[tours.Count - 1].TourId);
            int numAc = ots.GetAllFilteredTours(null, null, null, false).Count;

            Assert.AreEqual(numEx, numAc);
        }