public void EditingTour()
        {
            var UoW = new Mock <UnitOfWork>();

            UoW.Object.DeleteDB();

            var TourLogic = new TourLogic(UoW.Object);
            var UserLogic = new UserLogic(UoW.Object);

            UserLogic.AddUser(new Logic.DTOs.UserDTO("Sasha", Logic.DTOs.UserType.Manager, "Veklych", "Login", "Password"));
            UserLogic.Login("Login", "Password");

            TourLogic.AddTour(new Logic.DTOs.TourDTO("Karpaty", 250, "Excursion", "Ukraine", "Hust", 3, "Very nice mountains tour"));

            var Tour = TourLogic.GetAllToursTemplates().ToList()[0];

            Assert.That(TourLogic.GetAllToursTemplates().Count() == 1);
            Assert.That(Tour.Name == "Karpaty");
            Assert.That(Tour.Price == 250);
            Assert.That(Tour.Type == "Excursion");
            Assert.That(Tour.Country == "Ukraine");
            Assert.That(Tour.City == "Hust");
            Assert.That(Tour.Duration == 3);
            Assert.That(Tour.Description == "Very nice mountains tour");

            Tour.City        = "Lviv";
            Tour.Description = "Kek";

            TourLogic.EditTour(Tour.Id, Tour);

            Tour = TourLogic.GetAllToursTemplates().ToList()[0];

            Assert.That(TourLogic.GetAllToursTemplates().Count() == 1);
            Assert.That(Tour.Name == "Karpaty");
            Assert.That(Tour.Price == 250);
            Assert.That(Tour.Type == "Excursion");
            Assert.That(Tour.Country == "Ukraine");
            Assert.That(Tour.City == "Lviv");
            Assert.That(Tour.Duration == 3);
            Assert.That(Tour.Description == "Kek");
        }
Beispiel #2
0
        public void EditingTour()
        {
            var UoW = new Mock <UnitOfWork>();

            UoW.Object.DeleteDB();

            var TourLogic = new TourLogic(UoW.Object);
            var UserLogic = new UserLogic(UoW.Object);

            UserLogic.AddUser(new BLL.DTOs.UserDTO("Liza", BLL.DTOs.UserType.Manager, "Bril", "Login", "Password"));
            UserLogic.Login("Login", "Password");

            TourLogic.AddTour(new BLL.DTOs.TourDTO("Krakow tour", 250, "Excursion", "Poland", "Krakow", 3, "The best tour to Krakow"));

            var Tour = TourLogic.GetAllToursTemplates().ToList()[0];

            Assert.That(TourLogic.GetAllToursTemplates().Count() == 1);
            Assert.That(Tour.Name == "Krakow tour");
            Assert.That(Tour.Price == 250);
            Assert.That(Tour.Type == "Excursion");
            Assert.That(Tour.Country == "Poland");
            Assert.That(Tour.City == "Krakow");
            Assert.That(Tour.Duration == 3);
            Assert.That(Tour.Description == "The best tour to Krakow");

            Tour.City        = "Lviv";
            Tour.Description = "Kek";

            TourLogic.EditTour(Tour.Id, Tour);

            Tour = TourLogic.GetAllToursTemplates().ToList()[0];

            Assert.That(TourLogic.GetAllToursTemplates().Count() == 1);
            Assert.That(Tour.Name == "Krakow tour");
            Assert.That(Tour.Price == 250);
            Assert.That(Tour.Type == "Excursion");
            Assert.That(Tour.Country == "Poland");
            Assert.That(Tour.City == "Lviv");
            Assert.That(Tour.Duration == 3);
            Assert.That(Tour.Description == "Kek");
        }
Beispiel #3
0
        public void EditingTour()
        {
            var UoW = new Mock <UnitOfWork>();

            UoW.Object.DeleteDB();

            var TourLogic = new TourLogic(UoW.Object);
            var UserLogic = new UserLogic(UoW.Object);

            UserLogic.AddUser(new Logic.DTOs.UserDTO("Dimon", Logic.DTOs.UserType.Manager, "Cherneckii", "Login", "Password"));
            UserLogic.Login("Login", "Password");
            TourLogic.AddTour(new Logic.DTOs.TourDTO("odessa", 250, "Excursion", "Ukraine", "beach", 3, "go at beach and f**k a bithc"));

            var Tour = TourLogic.GetAllToursTemplates().ToList()[0];

            Assert.That(TourLogic.GetAllToursTemplates().Count() == 1);
            Assert.That(Tour.Name == "odessa");
            Assert.That(Tour.Price == 250);
            Assert.That(Tour.Type == "Excursion");
            Assert.That(Tour.Country == "Ukraine");
            Assert.That(Tour.City == "beach");
            Assert.That(Tour.Duration == 3);
            Assert.That(Tour.Description == "go at beach and f**k a bithc");

            Tour.City        = "odessa";
            Tour.Description = "lalka";

            TourLogic.EditTour(Tour.Id, Tour);

            Tour = TourLogic.GetAllToursTemplates().ToList()[0];

            Assert.That(TourLogic.GetAllToursTemplates().Count() == 1);
            Assert.That(Tour.Name == "ODessa");
            Assert.That(Tour.Price == 250);
            Assert.That(Tour.Type == "Excursion");
            Assert.That(Tour.Country == "Ukraine");
            Assert.That(Tour.City == "kyev");
            Assert.That(Tour.Duration == 3);
            Assert.That(Tour.Description == "Kek");
        }