Пример #1
0
        public void ReturnsTheResultFromTheCallback()
        {
            var target = new CallbackConsumerResolver <object>(_ => new StubConsumer());
            var result = target.Resolve(new Mock <IProducerConsumerContext <object> >().Object);

            Assert.IsInstanceOf <StubConsumer>(result);
        }
Пример #2
0
        public void DoesNotThrowAnErrorWhenTheResultIsNull()
        {
            var target = new CallbackConsumerResolver <object>(_ => null);
            var result = target.Resolve(new Mock <IProducerConsumerContext <object> >().Object);

            Assert.IsNull(result);
        }
Пример #3
0
        public void ThrowsAnExceptionWhenTheContextIsNull()
        {
            var target = new CallbackConsumerResolver <object>((context) => null);

            Assert.Throws <ArgumentNullException>(() => target.Resolve(null));
        }