public void GetDormantCustomers_GetByConditions_Page3()
        {
            // 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 = "10";
            List<User> users = new List<User>();
            DateTime startDate = DateTime.Now.AddYears(-1);
            DateTime endDate = DateTime.Now.AddYears(1);

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

            // Act
            ReportService reportService = new ReportService(uowMock.Object, repositoryMock.Object, settingsMock.Object);
            var currentResult = reportService
                .GetDormantCustomers( string.Empty, 2, 5);

            // Assert
            Assert.AreEqual(expectedResult, currentResult.Count());
            Assert.AreEqual(expectedName, currentResult.First().FirstName);
        }
        public void GetDormantCustomers_GetByConditions_NullUser()
        {
            // 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
            List<User> users = new List<User>();

            // Act
            ReportService reportService = new ReportService(uowMock.Object, repositoryMock.Object, settingsMock.Object);
            var currentResult = reportService
                .GetDormantCustomers(string.Empty,
                3, 5);

            // Assert
            Assert.AreEqual(null, currentResult);
        }