public void RequiredPathFieldMissing()
    {
        var dto = new GetWidgetRequestDto();

        dto.Validate(out var errorMessage).Should().BeFalse();
        errorMessage.Should().Be(ServiceDataUtility.GetRequiredFieldErrorMessage("id"));
    }
    public void ValidateGetWidgetHasPositiveId()
    {
        var dto = new GetWidgetRequestDto {
            Id = -1
        };

        dto.Validate(out var errorMessage).Should().BeFalse();
        errorMessage.Should().Be(ServiceDataUtility.GetInvalidFieldErrorMessage("id", "Must be at least 0."));
    }
    public void RequiredPathFieldSpecified()
    {
        var dto = new GetWidgetRequestDto {
            Id = 3
        };

        dto.Validate(out var errorMessage).Should().BeTrue();
        errorMessage.Should().BeNull();
    }
 public override async Task <ServiceResult <GetWidgetResponseDto> > GetWidgetAsync(GetWidgetRequestDto request, CancellationToken cancellationToken = default) =>
 ServiceResult.Success(new GetWidgetResponseDto {
     Widget = m_serializer.Clone(m_widgetResponse)
 });
 /// <summary>
 /// Gets the specified widget.
 /// </summary>
 public Task <ServiceResult <GetWidgetResponseDto> > GetWidgetAsync(GetWidgetRequestDto request, CancellationToken cancellationToken)
 {
     return(TrySendRequestAsync(ExampleApiHttpMapping.GetWidgetMapping, request, cancellationToken));
 }
 public Task <ServiceResult <GetWidgetResponseDto> > GetWidgetAsync(GetWidgetRequestDto request, CancellationToken cancellationToken = default) =>
 TrySendRequestAsync(ConformanceApiHttpMapping.GetWidgetMapping, request, cancellationToken);
 /// <inheritdoc />
 public Task <ServiceResult <GetWidgetResponseDto> > GetWidgetAsync(GetWidgetRequestDto request, CancellationToken cancellationToken = default) =>
 Task.FromResult(Execute <GetWidgetResponseDto>(request));