public async Task GetByPathAsync() { var apiClient = Substitute.For <IApiConnection>(); var client = new ArticleClient(apiClient); await client.GetByPathAsync("test", "test"); await apiClient.Received().ExecuteGetAsync <Article>("articles/test/test"); }
public async Task GetByPathAsync_EmptyUsername_Throw() { var apiClient = Substitute.For <IApiConnection>(); var client = new ArticleClient(apiClient); await Assert.ThrowsExceptionAsync <ArgumentNullException>(async() => await client.GetByPathAsync(string.Empty, "test")); await apiClient.DidNotReceive().ExecuteGetAsync <Article>(Arg.Any <string>()); }