public async Task ValidatesToTrueForValidStoredCodes() { //arrange var handler = new CheckValidPostcodeQueryHandler( Context ); var message = new CheckValidPostcodeQuery() { Postcode = new PostalCodeGeo { City = _postalCodeGeos[0].City, PostalCode = _postalCodeGeos[0].PostalCode, State = _postalCodeGeos[0].State } }; //act var result = await handler.Handle( message ); //assert Assert.True( result ); }
public async Task ValidatesToTrueForValidStoredCodes() { //arrange var handler = new CheckValidPostcodeQueryHandler(Context); var message = new CheckValidPostcodeQuery() { Postcode = new PostalCodeGeo { City = _postalCodeGeos[0].City, PostalCode = _postalCodeGeos[0].PostalCode, State = _postalCodeGeos[0].State } }; //act var result = await handler.Handle(message); //assert Assert.True(result); }
public async Task ReturnsFalseIfCityPostalCodeStateCombinationDoesNotMatch( bool cityFlag, bool postalcodeFlag, bool stateFlag ) { //arrange var handler = new CheckValidPostcodeQueryHandler( Context ); var message = new CheckValidPostcodeQuery { Postcode = new PostalCodeGeo { City = cityFlag ? _postalCodeGeos[1].City : "test", PostalCode = postalcodeFlag ? _postalCodeGeos[1].PostalCode : "test", State = stateFlag ? _postalCodeGeos[1].State : "test" } }; //act var result = await handler.Handle( message ); //assert Assert.False( result ); }
public async Task ReturnsFalseIfCityPostalCodeStateCombinationDoesNotMatch(bool cityFlag, bool postalcodeFlag, bool stateFlag) { //arrange var handler = new CheckValidPostcodeQueryHandler(Context); var message = new CheckValidPostcodeQuery { Postcode = new PostalCodeGeo { City = cityFlag ? _postalCodeGeos[1].City : "test", PostalCode = postalcodeFlag ? _postalCodeGeos[1].PostalCode : "test", State = stateFlag ? _postalCodeGeos[1].State : "test" } }; //act var result = await handler.Handle(message); //assert Assert.False(result); }