diff --git a/Vonage.Test/Video/ExperienceComposer/Start/E2ETest.cs b/Vonage.Test/Video/ExperienceComposer/Start/E2ETest.cs new file mode 100644 index 00000000..521c80d9 --- /dev/null +++ b/Vonage.Test/Video/ExperienceComposer/Start/E2ETest.cs @@ -0,0 +1,31 @@ +using System.Net; +using System.Threading.Tasks; +using Vonage.Test.Common.Extensions; +using WireMock.ResponseBuilders; +using Xunit; + +namespace Vonage.Test.Video.ExperienceComposer.Start; + +[Trait("Category", "E2E")] +public class E2ETest : E2EBase +{ + public E2ETest() : base(typeof(E2ETest).Namespace) + { + } + + [Fact] + public async Task Start() + { + this.Helper.Server.Given(WireMock.RequestBuilders.Request.Create() + .WithPath("/v2/project/e3e78a75-221d-41ec-8846-25ae3db1943a/render") + .WithHeader("Authorization", this.Helper.ExpectedAuthorizationHeaderValue) + .WithBody(this.Serialization.GetRequestJson(nameof(SerializationTest.ShouldSerialize))) + .UsingPost()) + .RespondWith(Response.Create().WithStatusCode(HttpStatusCode.OK) + .WithBody(this.Serialization.GetResponseJson(nameof(SessionSerializationTest.ShouldDeserialize200)))); + await this.Helper.VonageClient.VideoClient.ExperienceComposerClient + .StartAsync(SerializationTest.BuildRequest()) + .Should() + .BeSuccessAsync(SessionSerializationTest.BuildExpectedSession()); + } +} \ No newline at end of file diff --git a/Vonage.Test/Video/ExperienceComposer/Start/SerializationTest.cs b/Vonage.Test/Video/ExperienceComposer/Start/SerializationTest.cs index dcb22fb6..bd61c2ee 100644 --- a/Vonage.Test/Video/ExperienceComposer/Start/SerializationTest.cs +++ b/Vonage.Test/Video/ExperienceComposer/Start/SerializationTest.cs @@ -1,4 +1,5 @@ using System; +using Vonage.Common.Monads; using Vonage.Serialization; using Vonage.Server; using Vonage.Test.Common; @@ -16,17 +17,20 @@ public class SerializationTest JsonSerializerBuilder.BuildWithCamelCase()); [Fact] - public void ShouldSerialize() => StartRequest - .Build() - .WithApplicationId(Guid.NewGuid()) - .WithSessionId("flR1ZSBPY3QgMjkgMTI6MTM6MjMgUERUIDIwMTN") - .WithToken("830c9c9d-d09e-4513-9cc8-29c90a760248") - .WithUrl(new Uri("https://example.com/")) - .WithResolution(RenderResolution.StandardDefinitionLandscape) - .WithName("Composed stream for Live event #1") - .WithMaxDuration(1800) - .Create() + public void ShouldSerialize() => BuildRequest() .GetStringContent() .Should() .BeSuccess(this.helper.GetRequestJson()); + + internal static Result BuildRequest() => + StartRequest + .Build() + .WithApplicationId(new Guid("e3e78a75-221d-41ec-8846-25ae3db1943a")) + .WithSessionId("flR1ZSBPY3QgMjkgMTI6MTM6MjMgUERUIDIwMTN") + .WithToken("830c9c9d-d09e-4513-9cc8-29c90a760248") + .WithUrl(new Uri("https://example.com/")) + .WithResolution(RenderResolution.StandardDefinitionLandscape) + .WithName("Composed stream for Live event #1") + .WithMaxDuration(1800) + .Create(); } \ No newline at end of file