public async Task EnsuresNonNullArguments() { var client = new GistCommentsClient(Substitute.For <IApiConnection>()); await Assert.ThrowsAsync <ArgumentNullException>(() => client.Update("24", 1337, null)); await Assert.ThrowsAsync <ArgumentException>(() => client.Update("24", 1337, "")); }
public async Task PostsToCorrectUrl() { var comment = "This is a comment."; var connection = Substitute.For <IApiConnection>(); var client = new GistCommentsClient(connection); await client.Update("24", 1337, comment); connection.Received().Patch <GistComment>(Arg.Is <Uri>(u => u.ToString() == "gists/24/comments/1337"), Arg.Is <BodyWrapper>(x => x.Body == comment)); }
public async Task PostsToCorrectUrl() { var comment = "This is a comment."; var connection = Substitute.For<IApiConnection>(); var client = new GistCommentsClient(connection); await client.Update("24", 1337, comment); connection.Received().Patch<GistComment>(Arg.Is<Uri>(u => u.ToString() == "gists/24/comments/1337"), Arg.Is<BodyWrapper>(x => x.Body == comment)); }
public async Task EnsuresNonNullArguments() { var client = new GistCommentsClient(Substitute.For<IApiConnection>()); await Assert.ThrowsAsync<ArgumentNullException>(() => client.Update("24", 1337, null)); await Assert.ThrowsAsync<ArgumentException>(() => client.Update("24", 1337, "")); }