public void PutsCorrectUrl() { var connection = Substitute.For <IApiConnection>(); var client = new DealFieldsClient(connection); var editDealField = new DealFieldUpdate { Name = "name", Options = "{}" }; client.Edit(123, editDealField); connection.Received().Put <DealField>(Arg.Is <Uri>(u => u.ToString() == "dealFields/123"), Arg.Is <DealFieldUpdate>(df => df.Name == "name" && (string)df.Options == "{}")); }
public async Task EnsuresNonNullArguments() { var client = new DealFieldsClient(Substitute.For <IApiConnection>()); await Assert.ThrowsAsync <ArgumentNullException>(() => client.Edit(1, null)); }