コード例 #1
0
        public void Can_run_nested_service()
        {
            var host = new TestAppHost();

            host.Init();

            var request  = new Nested();
            var response = host.ExecuteService(request) as NestedResponse;

            Assert.That(response, Is.Not.Null);
        }
コード例 #2
0
        public void Can_run_test_service()
        {
            var host = new TestAppHost();

            host.Init();

            var request  = new Test();
            var response = host.ExecuteService(request) as TestResponse;

            Assert.That(response, Is.Not.Null);
            Assert.That(response.Foo, Is.Not.Null);
        }
コード例 #3
0
        public void Call_AsyncOneWay_endpoint_on_AsyncTestService_calls_ExecuteAsync()
        {
            var host = new TestAppHost();

            host.Init();

            TestAsyncService.ResetStats();

            var request  = new TestAsync();
            var response = host.ExecuteService(request, EndpointAttributes.OneWay) as TestAsyncResponse;

            Assert.That(response, Is.Not.Null);
            Assert.That(response.ExecuteTimes, Is.EqualTo(0));
            Assert.That(response.ExecuteAsyncTimes, Is.EqualTo(1));
        }
コード例 #4
0
 /// <summary>Should allow access when.</summary>
 ///
 /// <typeparam name="TRequestDto">Type of the request dto.</typeparam>
 /// <param name="withScenario">The with scenario.</param>
 public void ShouldAllowAccessWhen <TRequestDto>(EndpointAttributes withScenario)
     where TRequestDto : new()
 {
     ShouldNotThrow <UnauthorizedAccessException>(() => appHost.ExecuteService(new TRequestDto(), withScenario));
 }