public void ShouldNotDeleteUserIfCurrentlyLoggedIn()
        {
            var superAdminUser = SetupUsers(1, Role.SuperAdmin).Single();

            var deleteModel = new DeleteUserModel
            {
                Email  = superAdminUser.Email,
                UserId = superAdminUser.Id
            };

            var validator = new DeleteUserModelValidator(GetMockUserContext(superAdminUser, Role.SuperAdmin));

            validator.ShouldNotValidate(deleteModel,
                                        "The user is not allowed to delete themselves.");
        }
        public void ShouldNotDeleteUserIfRequiredFieldsEmpty()
        {
            var superAdminUser = SetupUsers(1, Role.SuperAdmin).Single();

            var deleteModel = new DeleteUserModel
            {
                Email  = "",
                UserId = ""
            };

            var validator = new DeleteUserModelValidator(GetMockUserContext(superAdminUser, Role.SuperAdmin));

            validator.ShouldNotValidate(deleteModel,
                                        "'User Id' must not be empty.",
                                        "The user you are trying to delete does not exist in the database.",
                                        "'Email' must not be empty.");
        }
        public void ShouldNotDeleteIfUserDoesNotExists()
        {
            var superAdminUser = SetupUsers(1, Role.SuperAdmin).Single();

            var testUserNotInSystem = new AdminAppUser
            {
                Email    = $"testuser{Guid.NewGuid():N}@test.com",
                UserName = $"testuser{Guid.NewGuid():N}@test.com"
            };

            var deleteModel = new DeleteUserModel
            {
                Email  = testUserNotInSystem.Email,
                UserId = testUserNotInSystem.Id
            };

            var validator = new DeleteUserModelValidator(GetMockUserContext(superAdminUser, Role.SuperAdmin));

            validator.ShouldNotValidate(deleteModel,
                                        "The user you are trying to delete does not exist in the database.");
        }