Exemplo n.º 1
0
        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();
        }
Exemplo n.º 3
0
        /// <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));
        }