public async Task RequestsCorrectUrl() { var connection = Substitute.For <IApiConnection>(); var client = new LeadsClient(connection); var filters = new LeadFilters { PageSize = 1, PageCount = 1, StartPage = 0, ArchivedStatus = ArchivedStatus.not_archived, }; await client.GetAll(filters); Received.InOrder(async() => { await connection.GetAll <Lead>( Arg.Is <Uri>(u => u.ToString() == "leads"), Arg.Is <Dictionary <string, string> >(d => d.Count == 1 && d["archived_status"] == "not_archived"), Arg.Is <ApiOptions>(o => o.PageSize == 1 && o.PageCount == 1 && o.StartPage == 0)); }); }
public async Task EnsuresNonNullArguments() { var client = new LeadsClient(Substitute.For <IApiConnection>()); await Assert.ThrowsAsync <ArgumentNullException>(() => client.GetAll(null)); }