public void ShouldThrowIfChannelIdIsMissingFromChannelCreateMessageRequest( Request request, [Target] DefaultUrlBuilder builder ) { request.Endpoint = ChannelEndpoint.CreateMessage; Action func = () => builder.BuildFromRequest(request); func.Should().Throw <MissingParameterException>() .And.Parameter.Should().Be("channel.id"); }
public void ShouldThrowIfGivenAnUnhandledEndpoint( Request request, [Target] DefaultUrlBuilder builder ) { var endpoint = (ChannelEndpoint)9999999; request.Endpoint = endpoint; Action func = () => builder.BuildFromRequest(request); func.Should().Throw <UnhandledEndpointException>() .And.Endpoint.Should().Be((Endpoint)endpoint); }
public void ShouldBuildChannelCreateMessageEndpoints( string channelId, Request request, Uri baseUrl, [Frozen] RequestOptions options, [Target] DefaultUrlBuilder builder ) { request.Endpoint = ChannelEndpoint.CreateMessage; request.Parameters["channel.id"] = channelId; var result = builder.BuildFromRequest(request); result.Should().Be($"{options.InvokeBaseUrl}/channels/{channelId}/messages"); }