public void Setup()
        {
            _fixture = AutoFixtureFactory.Create();

            _retryPolicyWrapperHook = (syncPolicy, asyncPolicy) => default(IRetryPolicy);

            _fixture.Register <Func <ISyncPolicy, IAsyncPolicy, IRetryPolicy> >(() => ((syncPolicy, asyncPolicy) => _retryPolicyWrapperHook(syncPolicy, asyncPolicy)));

            _fixture.RegisterMockOptions <FaultHandlingConfiguration>();

            _subject = _fixture.Create <RetryPolicyFactory>();
        }
Beispiel #2
0
        public void Setup()
        {
            _fixture = AutoFixtureFactory.Create();

            _mockRetryPolicyFactory = _fixture.Mock <IRetryPolicyFactory>();
            _noOpPolicyFactoryHook  = () => { };

            _fixture.Register(Enumerable.Empty <IExceptionRetryPredicate>);
            _fixture.Register <Func <NoOpRetryPolicy> >(() => () =>
            {
                _noOpPolicyFactoryHook();
                return(new NoOpRetryPolicy());
            });

            _subject = _fixture.Create <RetryPolicyCoordinator>();
        }
Beispiel #3
0
        public static IEnumerable <TestCaseData> CommonPropertyTypeTestCases()
        {
            var fixture = AutoFixtureFactory.Create();

            yield return(new TestCaseData(fixture.Create <string>(), true, true));

            yield return(new TestCaseData(fixture.Create <int>(), true, true));

            yield return(new TestCaseData(fixture.Create <Guid>(), true, true));

            yield return(new TestCaseData(fixture.Create <int?>(), true, true));

            yield return(new TestCaseData(fixture.Create <Guid?>(), true, true));

            yield return(new TestCaseData(fixture.Create <string>(), false, true));

            yield return(new TestCaseData(fixture.Create <int>(), false, true));

            yield return(new TestCaseData(fixture.Create <Guid>(), false, true));

            yield return(new TestCaseData(fixture.Create <int?>(), false, true));

            yield return(new TestCaseData(fixture.Create <Guid?>(), false, true));
        }
Beispiel #4
0
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="factory"><see cref="ApplicationTestServerFactory"/>.</param>
 public DistributionsControllerTests(ApplicationTestServerFactory factory)
 {
     fixture = AutoFixtureFactory.Create();
     client  = factory.Server.CreateAuthClient();
     SetupBackgroundJobClientMock();
 }
Beispiel #5
0
        public void Setup()
        {
            _fixture = AutoFixtureFactory.Create();

            _subject = _fixture.Create <ExponentialRetryBackoffCalculator>();
        }