Skip to content

Commit

Permalink
Add E2E for PLayTone
Browse files Browse the repository at this point in the history
  • Loading branch information
Tr00d committed Aug 2, 2023
1 parent c153a03 commit 27c8368
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Vonage.Server.Test/Video/Sip/PlayToneIntoCall/E2ETest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using System;
using System.Net;
using System.Threading.Tasks;
using Vonage.Common.Test.Extensions;
using Vonage.Server.Video.Sip.PlayToneIntoCall;
using WireMock.ResponseBuilders;
using Xunit;

namespace Vonage.Server.Test.Video.Sip.PlayToneIntoCall
{
[Trait("Category", "E2E")]
public class E2ETest : E2EBase
{
public E2ETest() : base(typeof(E2ETest).Namespace)
{
}

[Fact]
public async Task PLayToneIntoCall()
{
this.Helper.Server.Given(WireMock.RequestBuilders.Request.Create()
.WithPath(
"/v2/project/5e782e3b-9f63-426f-bd2e-b7d618d546cd/session/flR1ZSBPY3QgMjkgMTI6MTM6MjMgUERUIDIwMTN/play-dtmf")
.WithHeader("Authorization", "Bearer *")
.WithBody(this.Serialization.GetRequestJson(nameof(SerializationTest.ShouldSerialize)))
.UsingPost())
.RespondWith(Response.Create().WithStatusCode(HttpStatusCode.OK));
await this.Helper.VonageClient.SipClient.PlayToneIntoCallAsync(PlayToneIntoCallRequest.Build()
.WithApplicationId(Guid.Parse("5e782e3b-9f63-426f-bd2e-b7d618d546cd"))
.WithSessionId("flR1ZSBPY3QgMjkgMTI6MTM6MjMgUERUIDIwMTN")
.WithDigits("1713")
.Create())
.Should()
.BeSuccessAsync();
}
}
}
38 changes: 38 additions & 0 deletions Vonage.Server.Test/Video/Sip/PlayToneIntoConnection/E2ETest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;
using System.Net;
using System.Threading.Tasks;
using Vonage.Common.Test.Extensions;
using Vonage.Server.Video.Sip.PlayToneIntoConnection;
using WireMock.ResponseBuilders;
using Xunit;

namespace Vonage.Server.Test.Video.Sip.PlayToneIntoConnection
{
[Trait("Category", "E2E")]
public class E2ETest : E2EBase
{
public E2ETest() : base(typeof(E2ETest).Namespace)
{
}

[Fact]
public async Task PLayToneIntoConnection()
{
this.Helper.Server.Given(WireMock.RequestBuilders.Request.Create()
.WithPath(
"/v2/project/5e782e3b-9f63-426f-bd2e-b7d618d546cd/session/flR1ZSBPY3QgMjkgMTI6MTM6MjMgUERUIDIwMTN/connection/414ac9c2-9a6f-4f4b-aad4-202dbe7b1d8d/play-dtmf")
.WithHeader("Authorization", "Bearer *")
.WithBody(this.Serialization.GetRequestJson(nameof(SerializationTest.ShouldSerialize)))
.UsingPost())
.RespondWith(Response.Create().WithStatusCode(HttpStatusCode.OK));
await this.Helper.VonageClient.SipClient.PlayToneIntoConnectionAsync(PlayToneIntoConnectionRequest.Build()
.WithApplicationId(Guid.Parse("5e782e3b-9f63-426f-bd2e-b7d618d546cd"))
.WithSessionId("flR1ZSBPY3QgMjkgMTI6MTM6MjMgUERUIDIwMTN")
.WithConnectionId("414ac9c2-9a6f-4f4b-aad4-202dbe7b1d8d")
.WithDigits("1713")
.Create())
.Should()
.BeSuccessAsync();
}
}
}

0 comments on commit 27c8368

Please sign in to comment.