public void ReturnsTheResultFromTheCallback() { var target = new CallbackProducerResolver <object>(_ => new StubProducer()); var result = target.Resolve(new Mock <IProducerConsumerContext <object> >().Object); Assert.IsInstanceOf <StubProducer>(result); }
public void DoesNotThrowAnErrorWhenTheResultIsNull() { var target = new CallbackProducerResolver <object>(_ => null); var result = target.Resolve(new Mock <IProducerConsumerContext <object> >().Object); Assert.IsNull(result); }
public void ThrowsAnExceptionWhenTheContextIsNull() { var target = new CallbackProducerResolver <object>((context) => null); Assert.Throws <ArgumentNullException>(() => target.Resolve(null)); }