public void Should_Throw_On_Null_Settings_Parameter() { //Given ICakeContext context = _Context; string address = RootAddress; HttpSettings settings = null; //When var record = Record.Exception(() => HttpClientAliases.HttpGetAsByteArray(context, address, settings)); //Then CakeAssert.IsArgumentNullException(record, nameof(settings)); }
public void Should_Throw_On_Null_Or_Empty_Address_Parameter() { //Given ICakeContext context = _Context; HttpSettings settings = new HttpSettings(); string address = null; //When address = null; var nullRecord = Record.Exception(() => HttpClientAliases.HttpGetAsByteArray(context, address, settings)); address = ""; var emptyRecord = Record.Exception(() => HttpClientAliases.HttpGetAsByteArray(context, address, settings)); address = " "; var spaceRecord = Record.Exception(() => HttpClientAliases.HttpGetAsByteArray(context, address, settings)); //Then CakeAssert.IsArgumentNullException(nullRecord, nameof(address)); CakeAssert.IsArgumentNullException(emptyRecord, nameof(address)); CakeAssert.IsArgumentNullException(spaceRecord, nameof(address)); }