public void AddingTour()
        {
            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");
        }
Beispiel #2
0
        public void AddingTour()
        {
            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");
        }
Beispiel #3
0
        public void AddingTour()
        {
            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");
        }
Beispiel #4
0
        public void DeletingTour()
        {
            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", "Zaporogie", 3, "Go at beach"));

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

            Assert.That(TourLogic.GetAllToursTemplates().Count() == 1);

            TourLogic.DeleteTour(1);

            Assert.That(TourLogic.GetAllToursTemplates().Count() == 0);
        }
        public void FindingTour()
        {
            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"));
            TourLogic.AddTour(new Logic.DTOs.TourDTO("Karpaty1", 300, "Hot", "Hungary", "Moscow", 2, "Very nice mountains tour"));
            TourLogic.AddTour(new Logic.DTOs.TourDTO("Karpaty2", 300, "All", "Ukraine", "Moscow", 2, "Very nice mountains tour"));
            TourLogic.AddTour(new Logic.DTOs.TourDTO("Karpaty3", 300, "All", "Ukraine", "Kyiv", 3, "Very nice mountains tour"));
            TourLogic.AddTour(new Logic.DTOs.TourDTO("Karpaty4", 250, "Hot", "Hungary", "Hust", 3, "Very nice mountains tour"));
            TourLogic.AddTour(new Logic.DTOs.TourDTO("Karpaty5", 500, "Hot", "USA", "New Yourk", 10, "Very nice mountains tour"));

            Assert.That(TourLogic.GetAllToursTemplates().Count() == 6);

            Assert.That(TourLogic.FindTourTemplates("Hot").Count() == 3);
            Assert.That(TourLogic.FindTourTemplates("Excursion").Count() == 1);
            Assert.That(TourLogic.FindTourTemplates("Error").Count() == 0);
            Assert.That(TourLogic.FindTourTemplates("Excursion").ToList()[0].City == "Hust");

            Assert.That(TourLogic.FindTourTemplates("USA").Count() == 1);
            Assert.That(TourLogic.FindTourTemplates("Ukraine").Count() == 3);
            Assert.That(TourLogic.FindTourTemplates("Error").Count() == 0);
            Assert.That(TourLogic.FindTourTemplates("USA").ToList()[0].City == "New Yourk");

            Assert.That(TourLogic.FindTourTemplates("Moscow").Count() == 2);
            Assert.That(TourLogic.FindTourTemplates("New Yourk").Count() == 1);
            Assert.That(TourLogic.FindTourTemplates("Error").Count() == 0);

            Assert.That(TourLogic.FindTourTemplates("New Yourk").ToList()[0].Country == "USA");

            Assert.That(TourLogic.FindTourTemplatesByDuration(0, 3).Count() == 5);
            Assert.That(TourLogic.FindTourTemplatesByDuration(10, 10).Count() == 1);
            Assert.That(TourLogic.FindTourTemplatesByDuration(1000000, 10000000).Count() == 0);
            Assert.That(TourLogic.FindTourTemplatesByDuration(10, 20).ToList()[0].Country == "USA");
            Assert.That(TourLogic.FindTourTemplatesByDuration(10, 15).ToList()[0].Price == 500);


            Assert.That(TourLogic.FindTourTemplatesByPrice(250, 250).Count() == 2);
            Assert.That(TourLogic.FindTourTemplatesByPrice(250, 300).Count() == 5);
            Assert.That(TourLogic.FindTourTemplatesByPrice(100, 249).Count() == 0);
        }
Beispiel #6
0
        public void FindingTour()
        {
            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", "Zaporogie", 3, "Go at beach"));
            TourLogic.AddTour(new Logic.DTOs.TourDTO("ODessa1", 300, "Hot", "Hungary", "Moscow", 2, "Go at beach"));
            TourLogic.AddTour(new Logic.DTOs.TourDTO("ODessa2", 300, "All", "Ukraine", "Moscow", 2, "Go at beach"));
            TourLogic.AddTour(new Logic.DTOs.TourDTO("ODessa3", 300, "All", "Ukraine", "Kyiv", 3, "Go at beach"));
            TourLogic.AddTour(new Logic.DTOs.TourDTO("ODessa4", 250, "Hot", "Hungary", "Zaporogie", 3, "Go at beach"));
            TourLogic.AddTour(new Logic.DTOs.TourDTO("ODessa5", 500, "Hot", "USA", "New Yourk", 10, "Go at beach"));

            Assert.That(TourLogic.GetAllToursTemplates().Count() == 6);

            Assert.That(TourLogic.FindTourTemplates("Hot").Count() == 3);
            Assert.That(TourLogic.FindTourTemplates("Excursion").Count() == 1);
            Assert.That(TourLogic.FindTourTemplates("Error").Count() == 0);
            Assert.That(TourLogic.FindTourTemplates("Excursion").ToList()[0].City == "Zaporogie");

            Assert.That(TourLogic.FindTourTemplates("USA").Count() == 1);
            Assert.That(TourLogic.FindTourTemplates("Ukraine").Count() == 3);
            Assert.That(TourLogic.FindTourTemplates("Error").Count() == 0);
            Assert.That(TourLogic.FindTourTemplates("USA").ToList()[0].City == "New Yourk");

            Assert.That(TourLogic.FindTourTemplates("Moscow").Count() == 2);
            Assert.That(TourLogic.FindTourTemplates("New Yourk").Count() == 1);
            Assert.That(TourLogic.FindTourTemplates("Error").Count() == 0);

            Assert.That(TourLogic.FindTourTemplates("New Yourk").ToList()[0].Country == "USA");

            Assert.That(TourLogic.FindTourTemplatesByDuration(0, 3).Count() == 5);
            Assert.That(TourLogic.FindTourTemplatesByDuration(10, 10).Count() == 1);
            Assert.That(TourLogic.FindTourTemplatesByDuration(1000000, 10000000).Count() == 0);
            Assert.That(TourLogic.FindTourTemplatesByDuration(10, 20).ToList()[0].Country == "USA");
            Assert.That(TourLogic.FindTourTemplatesByDuration(10, 15).ToList()[0].Price == 500);


            Assert.That(TourLogic.FindTourTemplatesByPrice(250, 250).Count() == 2);
            Assert.That(TourLogic.FindTourTemplatesByPrice(250, 300).Count() == 5);
            Assert.That(TourLogic.FindTourTemplatesByPrice(100, 249).Count() == 0);
        }
Beispiel #7
0
        public void FindingTour()
        {
            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"));
            TourLogic.AddTour(new BLL.DTOs.TourDTO("Poznan tour", 150, "Excursion", "Poland", "Poznan", 3, "The best tour to Poznan"));
            TourLogic.AddTour(new BLL.DTOs.TourDTO("Morskie Oko", 340, "All", "Poland", "Morskie Oko", 2, "The best tour to mountains"));
            TourLogic.AddTour(new BLL.DTOs.TourDTO("Vancouver", 1890, "Excursion", "Canada", "Vancouver", 10, "The best tour to Vancouver"));
            TourLogic.AddTour(new BLL.DTOs.TourDTO("Lviv", 150, "Hot", "Ukraine", "Lviv", 3, "The best tour to Lviv"));
            TourLogic.AddTour(new BLL.DTOs.TourDTO("Karpaty", 500, "Hot", "Ukraine", "Karpaty", 10, "Very nice mountains tour"));

            Assert.That(TourLogic.GetAllToursTemplates().Count() == 6);

            Assert.That(TourLogic.FindTourTemplates("Hot").Count() == 2);
            Assert.That(TourLogic.FindTourTemplates("Excursion").Count() == 3);
            Assert.That(TourLogic.FindTourTemplates("Error").Count() == 0);
            Assert.That(TourLogic.FindTourTemplates("Excursion").ToList()[0].City == "" + "Krakow");

            Assert.That(TourLogic.FindTourTemplates("Poland").Count() == 3);
            Assert.That(TourLogic.FindTourTemplates("Ukraine").Count() == 2);
            Assert.That(TourLogic.FindTourTemplates("Error").Count() == 0);
            Assert.That(TourLogic.FindTourTemplates("Canada").ToList()[0].City == "Vancouver");

            Assert.That(TourLogic.FindTourTemplates("Ukraine").Count() == 2);
            Assert.That(TourLogic.FindTourTemplates("Vancouver").Count() == 1);
            Assert.That(TourLogic.FindTourTemplates("Error").Count() == 0);

            Assert.That(TourLogic.FindTourTemplatesByDuration(1, 3).Count() == 4);
            Assert.That(TourLogic.FindTourTemplatesByDuration(10, 10).Count() == 2);
            Assert.That(TourLogic.FindTourTemplatesByDuration(1000000, 10000000).Count() == 0);
            Assert.That(TourLogic.FindTourTemplatesByDuration(10, 20).ToList()[0].Country == "Canada");

            Assert.That(TourLogic.FindTourTemplatesByPrice(250, 250).Count() == 1);
            Assert.That(TourLogic.FindTourTemplatesByPrice(250, 340).Count() == 2);
        }