-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement BuildVerificationRequest on StartVerificationResponse
- Loading branch information
Showing
3 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
Vonage.Test.Unit/VerifyV2/StartVerification/StartVerificationResponseTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using FluentAssertions; | ||
using Vonage.Common.Monads; | ||
using Vonage.Common.Test.Extensions; | ||
using Vonage.VerifyV2.StartVerification; | ||
using Xunit; | ||
|
||
namespace Vonage.Test.Unit.VerifyV2.StartVerification | ||
{ | ||
public class StartVerificationResponseTest | ||
{ | ||
[Theory] | ||
[InlineData("")] | ||
[InlineData(" ")] | ||
[InlineData(null)] | ||
public void BuildVerificationRequest_ShouldReturnFailure_GivenCodeIsNullOrWhitespace(string value) => | ||
new StartVerificationResponse(Guid.NewGuid(), Maybe<Uri>.None) | ||
.BuildVerificationRequest(value) | ||
.Should() | ||
.BeParsingFailure("Code cannot be null or whitespace."); | ||
|
||
[Fact] | ||
public void BuildVerificationRequest_ShouldReturnSuccess() => | ||
new StartVerificationResponse(new Guid("06547d61-7ac0-43bb-94bd-503b24b2a3a5"), Maybe<Uri>.None) | ||
.BuildVerificationRequest("Some code.") | ||
.Should() | ||
.BeSuccess(request => | ||
{ | ||
request.RequestId.Should().Be(new Guid("06547d61-7ac0-43bb-94bd-503b24b2a3a5")); | ||
request.Code.Should().Be("Some code."); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters