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"); }
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"); }
public void ReservingTour() { var UoW = new Mock <UnitOfWork>(); UoW.Object.DeleteDB(); var TourLogic = new TourLogic(UoW.Object); var UserLogic = new UserLogic(UoW.Object); TourLogic.AddTour(new BLL.DTOs.TourDTO("Krakow tour", 250, "Excursion", "Poland", "Krakow", 3, "The best tour to Krakow")); UserLogic.AddUser(new BLL.DTOs.UserDTO("Liza", BLL.DTOs.UserType.Manager, "Bril", "Login", "Password")); UserLogic.ReserveTour(1, 1); var User = UserLogic.GetAllUsers().First(u => u.Id == 1); Assert.That(User.Tours.Count() == 1); Assert.That(User.Tours[0].Name == "Krakow tour"); Assert.That(User.Tours[0].Price == 250); Assert.That(User.Tours[0].Type == "Excursion"); Assert.That(User.Tours[0].Country == "Poland"); Assert.That(User.Tours[0].City == "Krakow"); Assert.That(User.Tours[0].Duration == 3); Assert.That(User.Tours[0].Description == "The best tour to Krakow"); }
public void ReservingTour() { var UoW = new Mock <UnitOfWork>(); UoW.Object.DeleteDB(); var TourLogic = new TourLogic(UoW.Object); var UserLogic = new UserLogic(UoW.Object); TourLogic.AddTour(new Logic.DTOs.TourDTO("Karpaty", 250, "Excursion", "Ukraine", "Hust", 3, "Very nice mountains tour")); UserLogic.AddUser(new Logic.DTOs.UserDTO("Sasha", Logic.DTOs.UserType.Manager, "Veklych", "Login", "Password")); UserLogic.ReserveTour(1, 1); var User = UserLogic.GetAllUsers().First(u => u.Id == 1); Assert.That(User.Tours.Count() == 1); Assert.That(User.Tours[0].Name == "Karpaty"); Assert.That(User.Tours[0].Price == 250); Assert.That(User.Tours[0].Type == "Excursion"); Assert.That(User.Tours[0].Country == "Ukraine"); Assert.That(User.Tours[0].City == "Hust"); Assert.That(User.Tours[0].Duration == 3); Assert.That(User.Tours[0].Description == "Very nice mountains tour"); }
public void ReservingTour() { var UoW = new Mock <UnitOfWork>(); UoW.Object.DeleteDB(); var TourLogic = new TourLogic(UoW.Object); var UserLogic = new UserLogic(UoW.Object); TourLogic.AddTour(new Logic.DTOs.TourDTO("ODessa", 250, "Excursion", "Ukraine", "Zaporogie", 3, "Go at beach")); UserLogic.AddUser(new Logic.DTOs.UserDTO("Dimon", Logic.DTOs.UserType.Manager, "Cherneckii", "Login", "Password")); UserLogic.ReserveTour(1, 1); var User = UserLogic.GetAllUsers().First(u => u.Id == 1); Assert.That(User.Tours.Count() == 1); Assert.That(User.Tours[0].Name == "ODessa"); Assert.That(User.Tours[0].Price == 250); Assert.That(User.Tours[0].Type == "Excursion"); Assert.That(User.Tours[0].Country == "Ukraine"); Assert.That(User.Tours[0].City == "Zaporogie"); Assert.That(User.Tours[0].Duration == 3); Assert.That(User.Tours[0].Description == "Go at beach"); }
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"); }
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); }
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); }
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 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); }