Beispiel #1
0
        public async Task BreakerTest1()
        {
            //ARRANGE
            var validator = new BackchannelCertificateValidatorMock(() => true);
            var webClient = new HttpDocumentRetrieverMock(validator);
            var manager   = new StateManager(new TimeManager(), new StateProviderMock());

            BreakerProxy.StateProviderFactory(() => manager);
            var breaker = BreakerProxy.Instance;

            var executingContext = new BreakerExecutionContext {
                Action = () => webClient.GetDocumentAsync("https://dg-mfb/idp/shibboleth", CancellationToken.None)
            };
            //ACT
            var response = await breaker.Execute(executingContext);

            //ASSERT
        }
Beispiel #2
0
        public async Task BreakerTest()
        {
            //ARRANGE
            var validator = new BackchannelCertificateValidatorMock(() => true);
            var webClient = new HttpDocumentRetrieverMock(validator);
            var manager   = new StateManager(new TimeManager(), new StateProviderMock());

            BreakerProxy.StateProviderFactory(() => manager);
            var breaker          = BreakerProxy.Instance;
            var result           = String.Empty;
            var executingContext = new BreakerExecutionContext {
                Action = () => throw new NotImplementedException()
            };
            //ACT
            var response = await breaker.Execute(executingContext);

            //ASSERT
        }