Exemple #1
0
        public void WhenRouteToBookServiceDelete_ThrowsInvalidOperationException()
        {
            _bookServiceEndPointsMock.Setup(t => t.Value)
            .Returns(() => new BookServiceEndPointConstants {
                Delete = string.Empty
            });

            _bookDispatchService = new BookServiceDispatcher(_bookServiceEndPointsMock.Object, _dispatcherMock.Object);

            Assert.Throws <InvalidOperationException>(() =>
                                                      _bookDispatchService.RouteToBookServiceDelete(1, 5));
        }
Exemple #2
0
        public void WhenRouteToBookServiceDelete_DispatchReturnsSuccess()
        {
            _bookServiceEndPointsMock.Setup(t => t.Value).Returns(() => new BookServiceEndPointConstants
            {
                Delete = "https://{userid}"
            });

            _bookDispatchService = new BookServiceDispatcher(_bookServiceEndPointsMock.Object, _dispatcherMock.Object);

            _bookDispatchService.RouteToBookServiceDelete(1, 5);

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