public async Task GetAllUserRequests_ShouldReturnCorrectResult()
        {
            var errorMessagePrefix = "UserRequestsService  GetAllUserRequests() method does not work properly.";

            // Arrange
            MapperInitializer.InitializeMapper();
            var context = HotelDbContextInMemoryFactory.InitializeContext();
            var userRequestRepository = new EfDeletableEntityRepository <UserRequest>(context);
            var userRequestsService   = this.GetUserRequestService(userRequestRepository);
            var seeder = new UserRequestsTestsSeeder();
            await seeder.SeedUserRequestsAsync(context);

            // Act
            var actualResult   = userRequestsService.GetAllUserRequests <DetailsUserRequestViewModel>().ToList();
            var expectedResult = new DetailsUserRequestViewModel[]
            {
                new DetailsUserRequestViewModel
                {
                    Id      = userRequestRepository.All().First().Id,
                    Email   = userRequestRepository.All().First().Email,
                    Content = userRequestRepository.All().First().Content,
                    Title   = userRequestRepository.All().First().Title,
                },
            };

            Assert.True(expectedResult[0].Id == actualResult[0].Id, errorMessagePrefix + " " + "Id is not returned properly.");
            Assert.True(expectedResult[0].Title == actualResult[0].Title, errorMessagePrefix + " " + "Title is not returned properly.");
            Assert.True(expectedResult[0].Content == actualResult[0].Content, errorMessagePrefix + " " + "Conteny is not returned properly.");
            Assert.True(expectedResult[0].Email == actualResult[0].Email, errorMessagePrefix + " " + "Email is not returned properly.");
        }
        public async Task DeleteByIdAsync_WithExistentId_ShouldSuccessfullyDelete()
        {
            var errorMessagePrefix = "UserRequestsService DeleteByIdAsync() method does not work properly.";

            // Arrange
            // Arrange
            MapperInitializer.InitializeMapper();
            var context = HotelDbContextInMemoryFactory.InitializeContext();
            var userRequestRepository = new EfDeletableEntityRepository <UserRequest>(context);
            var userRequestsService   = this.GetUserRequestService(userRequestRepository);
            var seeder = new UserRequestsTestsSeeder();
            await seeder.SeedUserRequestsAsync(context);

            var userRequestId = userRequestsService.All().First().Id;

            // Act
            var userRequestCount = userRequestRepository.All().Count();
            await userRequestsService.DeleteByIdAsync(userRequestId);

            var actualResult   = userRequestRepository.All().Count();
            var expectedResult = userRequestCount - 1;

            // Assert
            Assert.True(actualResult == expectedResult, errorMessagePrefix + " " + "Room types count is not reduced.");
        }
        public async Task GetUserRequestByIdAsync_WithExistentId_ShouldReturnCorrectResult()
        {
            var errorMessagePrefix = "UserRequestService GetUserRequestByIdAsync() method does not work properly.";

            // Arrange
            MapperInitializer.InitializeMapper();
            var context = HotelDbContextInMemoryFactory.InitializeContext();
            var userRequestRepository = new EfDeletableEntityRepository <UserRequest>(context);
            var userRequestsService   = this.GetUserRequestService(userRequestRepository);
            var seeder = new UserRequestsTestsSeeder();
            await seeder.SeedUserRequestsAsync(context);

            var userRequestId = userRequestsService.All().First().Id;

            // Act
            var actualResult = await userRequestsService.GetUserRequestByIdAsync(userRequestId);

            var expectedResult = await userRequestRepository
                                 .All()
                                 .SingleOrDefaultAsync(x => x.Id == userRequestId);

            // Assert
            Assert.True(expectedResult.Title == actualResult.Title, errorMessagePrefix + " " + "Title is not returned properly.");
            Assert.True(expectedResult.Email == actualResult.Email, errorMessagePrefix + " " + "Email is not returned properly.");
            Assert.True(expectedResult.Content == actualResult.Content, errorMessagePrefix + " " + "Content is not returned properly.");
        }
        public async Task DeleteByIdAsync_WithExistentId_ShouldReturnCorrectResult()
        {
            var errorMessagePrefix = "RoomTypeService DeleteByIdAsync() method does not work properly.";

            // Arrange
            MapperInitializer.InitializeMapper();
            var context = HotelDbContextInMemoryFactory.InitializeContext();
            var userRequestRepository = new EfDeletableEntityRepository <UserRequest>(context);
            var userRequestsService   = this.GetUserRequestService(userRequestRepository);
            var seeder = new UserRequestsTestsSeeder();
            await seeder.SeedUserRequestsAsync(context);

            var userRequestId = userRequestsService.All().First().Id;

            // Act
            var result = await userRequestsService.DeleteByIdAsync(userRequestId);

            // Assert
            Assert.True(result, errorMessagePrefix + " " + "Returns false.");
        }