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

            TourDTO tour = ots.GetAllFilteredTours(null, null, null, false)[0];

            Assert.AreEqual(tour.Country, ts.FindById(tour.TourId).Country);
            Assert.AreEqual(tour.Region, ts.FindById(tour.TourId).Region);
            Assert.AreEqual(tour.Hotel, ts.FindById(tour.TourId).Hotel);
        }
Exemplo n.º 2
0
        public void FindByIdTestWithException()
        {
            ResetData();
            var         uow = new Mock <UnitOfWork>();
            TourService ts  = new TourService(uow.Object);

            ts.FindById(-5);
        }
Exemplo n.º 3
0
        public void FindByIdTest()
        {
            ResetData();
            var               uow = new Mock <UnitOfWork>();
            TourService       ts  = new TourService(uow.Object);
            OutputTourService ots = new OutputTourService(uow.Object);

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

            ts.CreateTour(tour);

            List <TourDTO> tours = ots.GetAllFilteredTours(null, null, null, false);

            Assert.AreEqual(ts.FindById(tours[tours.Count - 1].TourId).Country, tour.Country);
        }