示例#1
0
        public async Task Measure_Greeter_SayHello_Sequential_WebApi(int numberOfsamples)
        {
            var sut = this.fixture.WebApi();

            TestAction act = () => sut.HttpGet("api/Greeting/greetling");

            var samples = await act.MeasureAsync(ApiStack.WebApi, numberOfsamples, Measure_Greeter_SayHello_Sequential);

            samples.Should().Be(numberOfsamples);
        }
示例#2
0
        public async Task Measure_Greeter_SayHello_Sequential_OData(int numberOfsamples)
        {
            var sut = this.fixture.OData();

            TestAction act = () => sut.HttpGet("odata/Greetings/greetling?api-version=1.0");

            var samples = await act.MeasureAsync(ApiStack.OData, numberOfsamples, Measure_Greeter_SayHello_Sequential);

            samples.Should().Be(numberOfsamples);
        }
示例#3
0
        public async Task Measure_Greeter_SayHello_Sequential_GRPC(int numberOfsamples)
        {
            var sut = this.fixture.gRPC();

            var request = new GreetingRequest()
            {
                Name = "greetling"
            };

            TestAction act = async() =>
            {
                var reply = await sut.SayHelloAsync(request);

                return(() => Task.FromResult(reply.Should().NotBeNull()));
            };

            var samples = await act.MeasureAsync(ApiStack.GRPC, numberOfsamples, Measure_Greeter_SayHello_Sequential);

            samples.Should().Be(numberOfsamples);
        }
示例#4
0
        public async Task Measure_Greeter_SayHello_Sequential_GraphQLDotNet_GraphTypesFirst(int numberOfsamples)
        {
            var payload = new GraphQlPayload()
            {
                query = @"
                query {
                  greeter {
                    sayHello(name:""greetling""){
                      content
                    }
                  }
                }"
            }.ToJson();
            var content = new StringContent(payload, Encoding.Default, "application/json");

            var sut = this.fixture.GraphQL();

            TestAction act = () => sut.GraphQLPost("graphql", content);

            var samples = await act.MeasureAsync(ApiStack.GQLnet_TypesFirst, numberOfsamples, Measure_Greeter_SayHello_Sequential);

            samples.Should().Be(numberOfsamples);
        }