public void WhenAuthorServiceEndPointConstantsPost_IsNull_ThrowsInvalidOperationException() { _optionsMock.Setup(t => t.Value).Returns(() => new AuthorServiceEndPointConstants { Post = "" }); _service = new AuthorServiceDispatcher(_dispatcherMock.Object, _optionsMock.Object); Assert.Throws <InvalidOperationException>(() => _service.RouteToAuthorPost( It.IsAny <PostAuthorDispatcherRequest>())); }
public void WhenRouteToAuthorPost_Success() { _service.RouteToAuthorPost(new PostAuthorDispatcherRequest() { Bio = "bio", Dead = null, Name = "name", Books = null, Birthday = DateTime.Now, Location = "", ImageUrl = "" }); _dispatcherMock.Verify( t => t.Dispatch <object, object>(It.IsAny <object>(), It.IsAny <string>(), null, HttpRequestCode.POST, null, null), Times.Once); }