public void Should_Throw_On_Null_Or_Empty_Context_Parameter() { //Given ICakeContext context = null; string address = RootAddress; HttpSettings settings = new HttpSettings(); //When var nullRecord = Record.Exception(() => HttpClientAliases.HttpPutAsByteArray(context, address, settings)); //Then CakeAssert.IsArgumentNullException(nullRecord, nameof(context)); }
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.HttpPutAsByteArray(context, address, settings)); address = ""; var emptyRecord = Record.Exception(() => HttpClientAliases.HttpPutAsByteArray(context, address, settings)); address = " "; var spaceRecord = Record.Exception(() => HttpClientAliases.HttpPutAsByteArray(context, address, settings)); //Then CakeAssert.IsArgumentNullException(nullRecord, nameof(address)); CakeAssert.IsArgumentNullException(emptyRecord, nameof(address)); CakeAssert.IsArgumentNullException(spaceRecord, nameof(address)); }