コード例 #1
0
        static async Task <int> Verify(VerifyOptions options)
        {
            try
            {
                var userId = await UserRegistrationQueryService.GetUserId(options.Email);

                await UserRegistrationCommandService.EmailVerified(userId, options.Email);
            }
            catch (Exception e)
            {
                Console.Error.WriteLine(e.Message);
            }

            return(0);
        }
        public async Task GetUserByPartialEmail()
        {
            var email        = "email";
            var emailQuery   = "EMa";
            var passwordHash = "passwordHash";

            var resultsBefore = await UserRegistrationQueryService.SearchUser(emailQuery);

            Assert.IsFalse(resultsBefore.Contains(email));

            await UserRegistrationCommandService.RegisterUser(email, passwordHash);

            var userId = await UserRegistrationQueryService.GetUserId(email);

            await UserRegistrationCommandService.EmailVerified(userId, email);

            var resultsAfter = await UserRegistrationQueryService.SearchUser(emailQuery);

            Assert.IsTrue(resultsAfter.Contains(email));
        }