示例#1
0
                public async Task WhenCalled_ReturnsVerificationCode()
                {
                    var helper  = new FakeUserHelper1();
                    var userKey = new UserKey("1");

                    var token = await helper.CreateEmailVerificationCode(userKey);

                    Assert.NotNull(token);
                }
示例#2
0
                public async Task WhenCalled_SetsExpirationTo7Days()
                {
                    var helper  = new FakeUserHelper1();
                    var userKey = new UserKey("1");

                    var code = await helper.CreateEmailVerificationCode(userKey);

                    Assert.Equal(helper.FakeClock.UtcNow.AddDays(7),
                                 helper.FakeSingleUseTokenService.Create_InputExpiration);
                }
示例#3
0
                public async Task WhenCalled_CallsCreateOnTokenService()
                {
                    var helper  = new FakeUserHelper1();
                    var userKey = new UserKey("1");

                    var token = await helper.CreateEmailVerificationCode(userKey);

                    Assert.True(helper.FakeSingleUseTokenService.Create_Called);
                    Assert.Equal(helper.FakeSingleUseTokenService.Create_InputToken.Value,
                                 $"em-1-{token.Value}");
                }