public void OutputPostBuilder_AfterBuildAndReset_HasNoStateLeft() { var builder = new OutputPostBuilder().SetDate(DateTime.Today); IOutputPost output = builder.BuildAndReset(); Assert.That(builder.OutputPost, Is.Not.SameAs(output)); }
public async Task OutputService_AddOutput_CallsCorrectUri(IOutputPost outputToPost, string expectedQueryString) { PVOutputClient client = TestUtility.GetMockClient(out MockHttpMessageHandler testProvider); testProvider.ExpectUriFromBase(ADDOUTPUT_URL) .WithQueryString(expectedQueryString) .RespondPlainText(""); await client.Output.AddOutputAsync(outputToPost); testProvider.VerifyNoOutstandingExpectation(); }
/// <inheritdoc /> public Task <PVOutputBasicResponse> AddOutputAsync(IOutputPost output, CancellationToken cancellationToken = default) { var loggingScope = new Dictionary <string, object>() { [LoggingEvents.RequestId] = LoggingEvents.OutputService_AddOutput }; Guard.Argument(output, nameof(output)).NotNull(); var handler = new RequestHandler(Client); return(handler.ExecutePostRequestAsync(new AddOutputRequest() { Output = output }, loggingScope, cancellationToken)); }