コード例 #1
0
        public async void PutWithEmptyResult()
        {
            var settings = CreateServiceAgentSettings();
            var serviceProvider = CreateServiceProvider(settings);
            var agent = new TestAgent(serviceProvider, Options.Create(settings));
            agent.HttpClient = CreateClient();

            await agent.PutWithEmptyResultAsync(new TestModel { Name = "Name3", Number = 350 });

            var sentData = await agent.GetPreviousDataAsync();
            Assert.NotNull(sentData);
            Assert.Equal("Name3", sentData.Name);
            Assert.Equal(350, sentData.Number);
        }
コード例 #2
0
        public async void Delete()
        {
            var settings = CreateServiceAgentSettings();
            var serviceProvider = CreateServiceProvider(settings);
            var agent = new TestAgent(serviceProvider, Options.Create(settings));
            agent.HttpClient = CreateClient();

            await agent.DeleteAsync();

            var sentData = await agent.GetPreviousDataAsync();
            Assert.NotNull(sentData);
            Assert.Equal("Deleted", sentData.Name);
            Assert.Equal(123, sentData.Number);
        }