Beispiel #1
0
        public async Task NoMatchingOrchestrator(CauseAnarchyType causeAnarchyType)
        {
            //arrange
            var orchestrator = GetMockOrchestratorWithAnarchyTypeAndHandlingState(false, causeAnarchyType);

            var sut = new AnarchyManagerNew(new[] { orchestrator });

            var context = Get.CustomBuilderFor.MockHttpContext.Build();
            var next    = Substitute.For <RequestDelegate>();

            //act
            await sut.HandleRequest(context, next);

            //assert
            await orchestrator.Received(0).HandleRequest(context, next);
        }
Beispiel #2
0
        private IActionOrchestrator GetMockOrchestratorWithAnarchyTypeAndHandlingState(bool canHandle, CauseAnarchyType anarchyType)
        {
            var action = Get.CustomBuilderFor
                         .MockAnarchyAction
                         .WithCauseAnarchyType(anarchyType)
                         .Build();

            var orchestrator = Get.CustomBuilderFor
                               .MockAnarchyActionOrchestrator
                               .WithAction(action)
                               .ThatHasCanHandleResponse(canHandle);

            return(orchestrator.Build());
        }
Beispiel #3
0
 public MockAnarchyActionBuilder WithCauseAnarchyType(CauseAnarchyType causeAnarchyType)
 {
     _causeAnarchyType = causeAnarchyType;
     return(this);
 }