public void When_PublisherServiceEndPointConstantsPut_IsNull_ThrowsInvalidOperationException() { _optionsMock.Setup(t => t.Value).Returns(() => new PublisherServiceEndPointConstants { Put = "" }); _service = new PublisherServiceDispatcher(_dispatcherMock.Object, _optionsMock.Object); Assert.Throws <InvalidOperationException>(() => _service.RouteToPublisherPut( It.IsAny <PutPublisherDispatcherRequest>())); }
public void When_RouteToPublisherPut_Returns_Success_VerifyDispatcherCall_Once() { _service.RouteToPublisherPut(new PutPublisherDispatcherRequest { Id = "id", Name = "name", Series = null }); _dispatcherMock.Verify( t => t.Dispatch <object, object>(It.IsAny <object>(), It.IsAny <string>(), null, HttpRequestCode.PUT, null, null), Times.Once); }