public void ProcessSelectedUserRolesTests()
        {
            //Arrange
            var allRoles      = UserRoleAdminPageModelServiceTests.GetAllRoleModels();
            var selectedRoles = UserRoleAdminPageModelServiceTests.GetSelectedRoles();

            //Act
            var result = new UserRoleAdminPageModelService().ProcessSelectedUserRoles(selectedRoles, allRoles);

            //Assert
            Assert.IsNotNull(result);
            Assert.IsTrue(result.Any());
            Assert.IsTrue(result.Count == 1);
            Assert.IsTrue(result.Exists(r => r.RoleId == 1 && r.RoleName == "Role1"));
        }
        public void ProcessSelectedUserRolesInvalidTests()
        {
            //Arrange
            var allRoles      = UserRoleAdminPageModelServiceTests.GetAllRoleModels();
            var selectedRoles = UserRoleAdminPageModelServiceTests.GetSelectedRoles();

            //Act
            var result = new UserRoleAdminPageModelService().ProcessSelectedUserRoles(new StringValues(), allRoles);

            //Assert
            Assert.IsNull(result);

            //Act
            result = new UserRoleAdminPageModelService().ProcessSelectedUserRoles(selectedRoles, null);

            //Assert
            Assert.IsNull(result);

            RoleModels emptyRoles = new RoleModels {
                Roles = null
            };

            //Act
            result = new UserRoleAdminPageModelService().ProcessSelectedUserRoles(selectedRoles, emptyRoles);

            //Assert
            Assert.IsNull(result);

            emptyRoles = new RoleModels {
                Roles = new List <RoleModel>()
            };

            //Act
            result = new UserRoleAdminPageModelService().ProcessSelectedUserRoles(selectedRoles, emptyRoles);

            //Assert
            Assert.IsNull(result);
        }