public void UnAuthorizedUserCannotLogout()
        {
            var data = new HotelBookingSystemData();
            var controller = new UsersController(data, null);

            controller.Logout();
        }
        public void TestAll_InitializeNoVenues_ViewShouldHaveNoVenues()
        {
            // Arrange
            var owner = new User("shefa", "mnMiELud123", Roles.VenueAdmin);
            var data = new HotelBookingSystemData();
            var controller = new VenuesController(data, owner);

            // Act
            var view = controller.All().Display();

            // Assert
            Assert.AreEqual("There are currently no venues to show.", view);
        }
        public void TestAll_InitializeValidVenues_ViewShouldNotBeNull()
        {
            // Arrange
            var owner = new User("shefa", "mnMiELud123", Roles.VenueAdmin);
            var data = new HotelBookingSystemData();
            data.RepositoryWithVenues.Add(new Venue("Hotel1", "SOfia", "Nope", owner));
            data.RepositoryWithVenues.Add(new Venue("Hotel2", "Plovdiv", "AbeImaNqkvo", null));
            data.RepositoryWithVenues.Add(new Venue("Hotel3", "Vraca", "NeMoaGonamerq", owner));

            // Act
            var view = new VenuesController(data, owner).All().Display();

            // Assert
            Assert.IsNotNull(view, "Venues view should not be null.");
        }
        public void TestAll_InitializeOneVenue_ViewShouldBeEqual()
        {
            // Arrange
            string expected = "*[1] Hotel1, located at SOfia" +
                Environment.NewLine +
                "Free rooms: 0";
            var owner = new User("shefa", "mnMiELud123", Roles.VenueAdmin);
            var data = new HotelBookingSystemData();
            data.RepositoryWithVenues.Add(new Venue("Hotel1", "SOfia", "Nope", owner));

            // Act
            var view = new VenuesController(data, owner).All().Display();

            // Assert
            Assert.AreEqual(expected, view);
        }
 public void SetUp()
 {
     this.sampleData = new HotelBookingSystemData();
     this.sampleUser = new User("SampleName", "SamplePassword", Roles.VenueAdmin);
     this.sampleController = new VenuesController(this.sampleData, this.sampleUser);
 }
 public void SetUp()
 {
     this.testData = new HotelBookingSystemData();
     this.testUser = new User("SampleName", "Samplepassword", Roles.User);
     this.testController = new UsersController(this.testData, this.testUser);
 }