public async Task ReturnsSuccessGivenValidEmailAndInviteCode()
        {
            Invitation _invitation = new Invitation(_email, _inviteCode, _subscriptionId);

            _repository.Setup(r => r.GetAsync(It.IsAny <InvitationByInviteCodeSpec>())).ReturnsAsync(_invitation);

            var result = await _newMemberService.VerifyValidEmailAndInviteCodeAsync(_email, _inviteCode);

            _repository.Verify(r => r.GetAsync(It.IsAny <InvitationByInviteCodeSpec>()), Times.Once);
            Assert.Equal(_validEmailAndInviteCodeString, result.Value);
        }
        public async void OnGet(string inviteCode, string email)
        {
            ErrorMessage = "";

            var validEmailAndInviteCode = await _newMemberService.VerifyValidEmailAndInviteCodeAsync(email, inviteCode);

            if (!validEmailAndInviteCode.Value.Equals("success"))
            {
                DisplayErrorMessage(validEmailAndInviteCode);
            }

            // if we get this far, email and invite code are valid
            Email      = email;
            InviteCode = inviteCode;
        }
    public async Task <PageResult> OnGet(string inviteCode, string email)
    {
        ErrorMessage = "";

        var validEmailAndInviteCode = await _newMemberService.VerifyValidEmailAndInviteCodeAsync(email, inviteCode);

        _logger.LogInformation($"{validEmailAndInviteCode.Value}");

        if (!validEmailAndInviteCode.Value.Equals("success"))
        {
            var errorMessage = "Your email or invite code is invalid. Please confirm you've clicked the correct link and try again.";
            DisplayErrorMessage(errorMessage);
        }

        // if we get this far, email and invite code are valid
        Email = email;

        return(Page());
    }