Пример #1
0
        public void WhenPublisherServiceEndPointConstantsPost_IsNull_ThrowsInvalidOperationException()
        {
            _optionsMock.Setup(t => t.Value).Returns(() => new PublisherServiceEndPointConstants {
                Post = ""
            });

            _service = new PublisherServiceDispatcher(_dispatcherMock.Object, _optionsMock.Object);

            Assert.Throws <InvalidOperationException>(() =>
                                                      _service.RouteToPublisherPost(
                                                          It.IsAny <PostPublisherDispatcherRequest>()));
        }
Пример #2
0
        public void WhenRouteToPublisherPost_Success()
        {
            _service.RouteToPublisherPost(new PostPublisherDispatcherRequest
            {
                Name   = "name",
                Series = null
            });


            _dispatcherMock.Verify(
                t => t.Dispatch <object, object>(It.IsAny <object>(), It.IsAny <string>(), null, HttpRequestCode.POST,
                                                 null, null), Times.Once);
        }