Esempio n. 1
0
        public async Task 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);
        }
Esempio n. 2
0
        public async Task 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);
        }