public async Task WhenCalled_ReturnsVerificationCode() { var helper = new FakeUserHelper1(); var userKey = new UserKey("1"); var token = await helper.CreateEmailVerificationCode(userKey); Assert.NotNull(token); }
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); }
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}"); }