public static async Task <string> GetOrganizationAsync(string ein) { var EIN = new EIN(ein); return(await GetAsync(BuildGetRequest(EIN, Domain.PremierV3)) .ConfigureAwait(false)); }
protected static Request BuildGetRequest(EIN ein, Domain domain) { return(new Request( HttpMethod.Get, GetSubscriptionKey(domain), domain, queryParam: ein.EinString )); }
public static string GetOrganization(string ein) { var EIN = new EIN(ein); return(Get(BuildGetRequest(EIN, Domain.PremierV3))); }
public void EIN_CorrectFormat_ExpectSuccess() { var ein = new EIN("12-3456789"); Assert.Equal("12-3456789", ein.EinString); }
public static string GetOrganization(string ein) { var EIN = new EIN(ein); return(Get(BuildGetRequest(EIN, Domain.CharityCheckV1))); }
public void EIN_Garbage_ExpectArgException() { Assert.Throws <ArgumentException>(() => { var ein = new EIN("asdlkfj"); }); }
public void EIN_TwoHyphens_ExpectArgException() { Assert.Throws <ArgumentException>(() => { var ein = new EIN("12-345-678"); }); }
public void EIN_8Digits_ExpectArgException() { Assert.Throws <ArgumentException>(() => { var ein = new EIN("12-345678"); }); }
public void EIN_Spaces_ExpectNullException() { Assert.Throws <ArgumentNullException>(() => { var ein = new EIN(" "); }); }
public void EIN_9Digits_ExpectReformat() { var ein = new EIN("123456789"); Assert.Equal("12-3456789", ein.EinString); }