public void Smoke()
        {
            //arrange
            var repository = new Mock<IUsersRepository>();
            var userManagement = new UserManagementController(repository.Object);

            //act/post
            Assert.That(userManagement, Is.Not.Null);
        }
        public void GetIndex_ReturnsView()
        {
            //arrange
            var repository = new Mock<IUsersRepository>();
            var userManagement = new UserManagementController(repository.Object);

            //act
            var result = userManagement.Index() as ViewResult;

            //assert
            Assert.That(result, Is.Not.Null);
        }
        public void GetTable_ReturnsAllUsersList()
        {
            //arrange 
            var repository = new Mock<IUsersRepository>();
            var usersList = new List<User>
            {
                new User { Email = "*****@*****.**" },
                new User { Email = "*****@*****.**" },
                new User { Email = "*****@*****.**" },
                new User { Email = "*****@*****.**", Temp = true }
            };
            repository.Setup(r => r.Users).Returns(usersList.AsQueryable());

            var userManagement = new UserManagementController(repository.Object);

            //act
            var result = userManagement.Table() as ViewResult;

            //post
            var model = result.ViewData.Model as List<User>;
            Assert.That(model, Is.Not.Null);
            Assert.That(model.Count, Is.EqualTo(4));
        }
        public void GetSummary_ReturnsSummaryObject()
        {
            //arrange 
            var repository = new Mock<IUsersRepository>();
            var usersList = new List<User>
            {
                new User { Email = "*****@*****.**" },
                new User { Email = "*****@*****.**" },
                new User { Email = "*****@*****.**" },
                new User { Email = "*****@*****.**", Temp = true }
            };
            repository.Setup(r => r.Users).Returns(usersList.AsQueryable());

            var userManagement = new UserManagementController(repository.Object);

            //act
            var result = userManagement.Summary() as ViewResult;

            //post
            var model = result.ViewData.Model as UserSummaryModel;
            Assert.That(model, Is.Not.Null);
            Assert.That(model.TotalRegisteredUsers, Is.EqualTo(4));
            Assert.That(model.TempUsers, Is.EqualTo(1));
        }