Пример #1
0
        public void OnceTestHandler_HasCorrectTimeout()
        {
            var handler = new OnceTestHandler();
            var reader  = HandlerMetadata.ReadExactlyOnce(handler);

            reader.GetTimeOut().ShouldBe(23);
        }
Пример #2
0
        public void UnadornedHandler_DoesNotHaveExactlyOnce()
        {
            var handler = new UnadornedHandlerAsync();
            var reader  = HandlerMetadata.ReadExactlyOnce(handler);

            reader.Enabled.ShouldBeFalse();
        }
Пример #3
0
        public void OnceTestHandler_DoesHaveExactlyOnce()
        {
            var handler = new OnceTestHandler();
            var reader  = HandlerMetadata.ReadExactlyOnce(handler);

            reader.Enabled.ShouldBeTrue();
        }
Пример #4
0
        public void OnceTestHandler_HasCorrectTimeout()
        {
            var handler = new OnceTestHandler();
            var reader  = HandlerMetadata.ReadExactlyOnce(handler);

            Assert.That(reader.GetTimeOut(), Is.EqualTo(23));
        }
Пример #5
0
        public void OnceTestHandler_DoesHaveExactlyOnce()
        {
            var handler = new OnceTestHandler();
            var reader  = HandlerMetadata.ReadExactlyOnce(handler);

            Assert.That(reader.Enabled, Is.True);
        }
Пример #6
0
        public void OnceHandlerWithImplicitTimeoutAsync_DefaultsToMaximum()
        {
            var handler = new OnceHandlerWithImplicitTimeoutAsync();
            var reader  = HandlerMetadata.ReadExactlyOnce(handler);

            Assert.That(reader.GetTimeOut(), Is.EqualTo(int.MaxValue));
        }
Пример #7
0
        public void UnadornedHandler_DoesNotHaveExactlyOnce()
        {
            var handler = new UnadornedHandlerAsync();
            var reader  = HandlerMetadata.ReadExactlyOnce(handler);

            Assert.That(reader.Enabled, Is.False);
        }
Пример #8
0
        public void WrappedHandler_DoesHaveExactlyOnce()
        {
            var wrapped = new BlockingHandler <GenericMessage>(new OnceTestHandler());

            var reader = HandlerMetadata.ReadExactlyOnce(wrapped);

            Assert.That(reader.Enabled, Is.True);
        }
Пример #9
0
        public void WrappedHandler_DoesHaveExactlyOnce()
        {
#pragma warning disable 618
            var wrapped = new BlockingHandler <GenericMessage>(new OnceTestHandler());
#pragma warning restore 618

            var reader = HandlerMetadata.ReadExactlyOnce(wrapped);

            reader.Enabled.ShouldBeTrue();
        }