コード例 #1
0
		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 );
		}
コード例 #2
0
        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);
        }
コード例 #3
0
		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 );
		}
コード例 #4
0
        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);
        }