public void Can_Get_PostalCodes_With_Related_Tax_Types() { A.CallTo(() => _postalCodeQueryProvider.Query).WithAnyArguments().Returns(PostalCodeTestData.PostalCodes); A.CallTo(() => _taxTypeQueryProvider.Query).WithAnyArguments().Returns(PostalCodeTestData.TaxTypes); _postalCodeController = new PostalCodeController(_postalCodeQueryProvider, _taxTypeQueryProvider); var results = _postalCodeController.Get(); Assert.IsTrue(results.Value.Count() > 0);//There is or are postal codes... foreach (var item in results.Value) { Assert.IsNotNull(item.TaxType); //All existing Postal Codes are linked to their relevent types... Assert.AreEqual(item.TaxTypeId, item.TaxType.Id); //There hasn't been data errors like mis-matching ID's on the Query... } }
public void CleanUpLocalFields() { serverURL = string.Empty; jsonMediaType = string.Empty; xmlMediaType = string.Empty; jsonFormatParameter = string.Empty; xmlFormatParameter = string.Empty; pageNumberSegment = string.Empty; pageSizeSegment = string.Empty; expectedResultCount = int.MinValue; countrySegment = string.Empty; expectedCountryName = string.Empty; clientHandler = null; client = null; expectedPostalCode = string.Empty; expectedISOCountryCode = string.Empty; rawPostalCodeControllerSegment = string.Empty; postalControllerObject = null; }
public void InitializelocalFields() { serverURL = generalSection["ServerURL"]; jsonMediaType = generalSection["JSONMediaType"]; xmlMediaType = generalSection["XMLMediaType"]; jsonFormatParameter = generalSection["JSONFormatParameter"]; xmlFormatParameter = generalSection["XMLFormatParameter"]; pageSizeSegment = generalSection["PageSizeSegment"]; pageNumberSegment = generalSection["PageNumberSegment"]; expectedResultCount = int.Parse(generalSection["ExpectedResultCount"]); countrySegment = generalSection["CountrySegment"]; expectedCountryName = countrySection["CountryName"]; clientHandler = new HttpClientHandler() { UseDefaultCredentials = true }; client = new HttpClient(clientHandler); expectedPostalCode = postalcodeSection["PostalCode"]; expectedISOCountryCode = countrySection["ISOCountryCode"]; rawPostalCodeControllerSegment = postalcodeSection["RawPostalCodeControllerSegment"]; postalControllerObject = new PostalCodeController(new RawPostalSQLRepository(config)); }