Exemplo n.º 1
0
        public void OnceTestHandler_HasCorrectTimeout()
        {
            var handler = new OnceTestHandler();
            var reader  = HandlerMetadata.ReadExactlyOnce(handler);

            reader.GetTimeOut().ShouldBe(23);
        }
Exemplo n.º 2
0
        public void UnadornedHandler_DoesNotHaveExactlyOnce()
        {
            var handler = new UnadornedHandlerAsync();
            var reader  = HandlerMetadata.ReadExactlyOnce(handler);

            reader.Enabled.ShouldBeFalse();
        }
Exemplo n.º 3
0
        public void OnceTestHandler_DoesHaveExactlyOnce()
        {
            var handler = new OnceTestHandler();
            var reader  = HandlerMetadata.ReadExactlyOnce(handler);

            reader.Enabled.ShouldBeTrue();
        }
Exemplo n.º 4
0
        public void OnceTestHandler_HasCorrectTimeout()
        {
            var handler = new OnceTestHandler();
            var reader  = HandlerMetadata.ReadExactlyOnce(handler);

            Assert.That(reader.GetTimeOut(), Is.EqualTo(23));
        }
Exemplo n.º 5
0
        public void OnceTestHandler_DoesHaveExactlyOnce()
        {
            var handler = new OnceTestHandler();
            var reader  = HandlerMetadata.ReadExactlyOnce(handler);

            Assert.That(reader.Enabled, Is.True);
        }
Exemplo n.º 6
0
        public void OnceHandlerWithImplicitTimeoutAsync_DefaultsToMaximum()
        {
            var handler = new OnceHandlerWithImplicitTimeoutAsync();
            var reader  = HandlerMetadata.ReadExactlyOnce(handler);

            Assert.That(reader.GetTimeOut(), Is.EqualTo(int.MaxValue));
        }
Exemplo n.º 7
0
        public void UnadornedHandler_DoesNotHaveExactlyOnce()
        {
            var handler = new UnadornedHandlerAsync();
            var reader  = HandlerMetadata.ReadExactlyOnce(handler);

            Assert.That(reader.Enabled, Is.False);
        }
Exemplo n.º 8
0
        public void WrappedHandler_DoesHaveExactlyOnce()
        {
            var wrapped = new BlockingHandler <GenericMessage>(new OnceTestHandler());

            var reader = HandlerMetadata.ReadExactlyOnce(wrapped);

            Assert.That(reader.Enabled, Is.True);
        }
Exemplo n.º 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();
        }