예제 #1
0
        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>()));
        }
예제 #2
0
        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);
        }