コード例 #1
0
        public void BaseTest3()
        {
            RetryPolicy policy = new RetryPolicy(TimeSpan.Zero);

            Assert.True(policy.IsValid());
            Assert.NotNull(policy.GetSync());
            Assert.NotNull(policy.GetAsync());
        }
コード例 #2
0
        public void BaseTest1()
        {
            RetryPolicy policy = new RetryPolicy();

            Assert.False(policy.IsValid());
            Assert.Null(policy.GetSync());
            Assert.Null(policy.GetAsync());
            Assert.Equal(3, policy.Index);
        }
コード例 #3
0
        public void BaseTest4()
        {
            RetryPolicy policy = new RetryPolicy(TimeSpan.FromMilliseconds(2000));

            Assert.True(policy.IsValid());
            Assert.NotNull(policy.GetSync());
            Assert.NotNull(policy.GetAsync());

            Assert.Single(policy.TimeSpans);
        }
コード例 #4
0
        public void BaseTest5()
        {
            RetryPolicy policy = new RetryPolicy(6, 500);

            Assert.True(policy.IsValid());
            Assert.NotNull(policy.GetSync());
            Assert.NotNull(policy.GetAsync());

            Assert.Equal(6, policy.RetryCount);
            Assert.Equal(500, policy.SleepDuration);
            Assert.Null(policy.TimeSpans);
        }