public async Task GetByIdAsync() { var apiConnection = Substitute.For <IApiConnection>(); var client = new CommentClient(apiConnection); await client.GetByIdAsync("123"); await apiConnection.Received().ExecuteGetAsync <Comment>("comments/123"); }
public async Task GetByIdAsync_CommentIdEmpty_Throw() { var apiConnection = Substitute.For <IApiConnection>(); var client = new CommentClient(apiConnection); await Assert.ThrowsExceptionAsync <ArgumentNullException>(async() => await client.GetByIdAsync(string.Empty)); await apiConnection.DidNotReceive().ExecuteGetAsync <Comment>(Arg.Any <string>()); }