public void GetCompliancesVerification_GetByConditions_NullDatabase_FirstPage()
        {
            // Setup dependency
            var settingsMock = new Mock<ISettings>();
            var repositoryMock = new Mock<IRepository>();
            var uowMock = new Mock<IUnitOfWork>();
            var serviceLocatorMock = new Mock<IServiceLocator>();
            serviceLocatorMock.Setup(x => x.GetInstance<IRepository>())
                .Returns(repositoryMock.Object);
            ServiceLocator.SetLocatorProvider(() => serviceLocatorMock.Object);

            // Arrange
            string keyword = string.Empty;
            int currentPage = 0;
            int pageSize = 5;

            // Act
            ManagementService managementService = new ManagementService(uowMock.Object, repositoryMock.Object, settingsMock.Object);
            var currentResult = managementService.GetCompliancesVerification(currentPage, pageSize,
                true, true, true, true);

            // Assert
            Assert.AreEqual(null, currentResult);
        }
        public void GetCompliancesVerification_GetByConditions_OrderByFirstName_FirstPage()
        {
            // Setup dependency
            var settingsMock = new Mock<ISettings>();
            var repositoryMock = new Mock<IRepository>();
            var uowMock = new Mock<IUnitOfWork>();
            var serviceLocatorMock = new Mock<IServiceLocator>();
            serviceLocatorMock.Setup(x => x.GetInstance<IRepository>())
                .Returns(repositoryMock.Object);
            ServiceLocator.SetLocatorProvider(() => serviceLocatorMock.Object);

            // Arrange
            decimal expectedResult = 5;
            string expectedName = "12";
            List<User> users = new List<User>();
            string keyword = string.Empty;
            int currentPage = 0;
            int pageSize = 5;

            for (int i = 0; i < 20; i++)
            {
                User user = new User
                {
                    Id = Guid.NewGuid(),
                    FirstName = i.ToString(),
                    Role = Role.Specialist
                };
                users.Add(user);
            }
            repositoryMock.Setup(r => r.Query<User>()).Returns(users.AsQueryable());

            // Act
            ManagementService managementService = new ManagementService(uowMock.Object, repositoryMock.Object, settingsMock.Object);
            var currentResult = managementService
                .GetCompliancesVerification(currentPage, pageSize,
                true,true,true,true);

            // Assert
            Assert.AreEqual(expectedResult, currentResult.Count());
            Assert.AreEqual(expectedName, currentResult.Last().FirstName);
        }