Пример #1
0
        public void CanCreateValidVerificationRequest()
        {
            var request = VerificationRequest.GenerateNewVerificationRequest("userId", VerificationType.Email, VerificationCode.Generate());

            request.Should().NotBeNull();
            request.Attempts.Should().Be(0);
            request.Status.Should().Be(VerificationRequestStatus.Pending);
            request.ExpiryDate.Should().BeAfter(DateTime.UtcNow);
        }
Пример #2
0
 public void VerificationCodeCannotBeNull()
 {
     Assert.Throws <ArgumentNullException>(() => VerificationRequest.GenerateNewVerificationRequest("userId", VerificationType.PhoneCall, null));
 }
Пример #3
0
 public void UserIdCannotBeNullOrEmpty(string userId)
 {
     Assert.Throws <ArgumentNullException>(() => VerificationRequest.GenerateNewVerificationRequest(userId, VerificationType.Email, null));
 }