Пример #1
0
                public async Task WhenCalled_ReturnsTrue()
                {
                    var helper = new FakeUserHelper1();

                    helper.FakeSingleUseTokenService.Validate_Output = true;

                    var result = await helper.ValidateEmailVerificationCode(
                        new UserKey("1"), 1111);

                    Assert.True(result);
                }
Пример #2
0
                public async Task InvalidToken_ReturnsFalse()
                {
                    var helper = new FakeUserHelper1();

                    helper.FakeSingleUseTokenService.Validate_Output = false;

                    var result = await helper.ValidateEmailVerificationCode(
                        new UserKey("1"), 1111);

                    Assert.False(result);
                }
Пример #3
0
                public async Task NullCode_Throws()
                {
                    UserHelper helper = new FakeUserHelper1();

                    await Assert.ThrowsAsync <ArgumentNullException>("code", async() =>
                    {
                        await helper.ValidateEmailVerificationCode(
                            userKey: "1",
                            code: null);
                    });
                }