[TestMethod()]//Check if the method does not return an empty result public void GetAvaERPCountryMappingTestToCheckIfItDoesNotReturnEmptyResult() { //Arrange var AccountInfo = AvaTaxProfileAssistantHelper.InsertAccountInfo(input.AccountCredentials); int AvaERPSettingsID = AvaTaxProfileAssistantHelper.InsertAvaERPSetting(input.AvaERPSettings, AccountInfo.ID); //Act foreach (MappedCountry mc in input.AvaERPSettings.AddressValidation.MappedCountries) { AvaTaxProfileAssistantHelper.InsertAvaERPCountryMapping(AccountInfo.ID, AvaERPSettingsID, mc); } var result = AvaTaxProfileAssistantHelper.GetAvaERPCountryMapping(AccountInfo.ID); //Assert Assert.IsNotNull(result, "Empty result returned!!"); }
[TestMethod()]//Check if the method returns correct number of mapped countries public void GetAvaERPCountryMappingTestToCheckIfItReturnsCorrectNumberOfMappedCountries() { //Arrange var AccountInfo = AvaTaxProfileAssistantHelper.InsertAccountInfo(input.AccountCredentials); int AvaERPSettingsID = AvaTaxProfileAssistantHelper.InsertAvaERPSetting(input.AvaERPSettings, AccountInfo.ID); //Act foreach (MappedCountry mc in input.AvaERPSettings.AddressValidation.MappedCountries) { AvaTaxProfileAssistantHelper.InsertAvaERPCountryMapping(AccountInfo.ID, AvaERPSettingsID, mc); } var result = AvaTaxProfileAssistantHelper.GetAvaERPCountryMapping(AccountInfo.ID); //Assert Assert.AreEqual(input.AvaERPSettings.AddressValidation.MappedCountries.Count, result.Count, "Incorrect number of mapped countries fetched!"); }
[TestMethod()]//Check if it returns a list of type AvaERPCountryMapping public void GetAvaERPCountryMappingTestToCheckIfItReturnsListOfAvaERPCountryMapping() { //Arrange var AccountInfo = AvaTaxProfileAssistantHelper.InsertAccountInfo(input.AccountCredentials); int AvaERPSettingsID = AvaTaxProfileAssistantHelper.InsertAvaERPSetting(input.AvaERPSettings, AccountInfo.ID); //Act foreach (MappedCountry mc in input.AvaERPSettings.AddressValidation.MappedCountries) { AvaTaxProfileAssistantHelper.InsertAvaERPCountryMapping(AccountInfo.ID, AvaERPSettingsID, mc); } var result = AvaTaxProfileAssistantHelper.GetAvaERPCountryMapping(AccountInfo.ID); //Assert Assert.IsInstanceOfType(result, typeof(List <AvaERPCountryMapping>), "Incorrect result type returned!!"); }