[TestInitialize]//Initializes data required for each test and runs once per test method.
        public void InitializeData()
        {
            //Arrange
            accountInfo = new AccountInfo();

            XmlReader xmlReader  = XmlReader.Create(@"..\XMLTestFiles\TPA_500.xml");
            var       tpa        = new TPAScaffold();
            var       serializer = new XmlSerializer(tpa.GetType());

            input = (TPAScaffold)serializer.Deserialize(xmlReader);

            tpaController = new TaxProfileAssistantController();
            tpaController.ControllerContext = new ControllerContext();
            string resultstr = tpaController.Post(input);
            string key       = resultstr.Substring(38);

            key         = key.Replace(Constants.APPLICATION_URL_DUMMY_TEXT, "/");
            accountInfo = AvaTaxProfileAssistantHelper.GetAccountInfoBySecureKey(key);

            nexusController = new NexusSetupController();
            accountService  = new AccountService(accountInfo.Webservice, accountInfo.UserName, accountInfo.Password, accountInfo.AccountNumber, accountInfo.LicenseKey, accountInfo.ERPName);
            TempData        = new TempDataDictionary();
            nexusController.TempData.Add("AccountInfo", accountInfo);
            nexusController.TempData.Add("AccountService", accountService);
        }
示例#2
0
        [TestMethod()]//check if resultset is not null.
        public void CreateNexusTestToCheckIfNullResultsetIsNotReturned()
        {
            //Arrange
            var    companyResult = AccountServiceHelper.CreateCompany(createCompany, accountInfo, createCompanyController);
            int    companyID     = companyResult.CompanyId;
            string country       = "IN";
            string state         = "MH";

            nexusController = new NexusSetupController();
            nexusController.TempData.Add("AccountInfo", accountInfo);
            nexusController.TempData.Add("AccountService", accountService);

            //Act

            var actualResult = AccountServiceHelper.CreateNexus(country, state, companyID, nexusController);

            //Assert
            Assert.IsNotNull(actualResult, "resultset must not be null!!");
        }
示例#3
0
        [TestMethod()]//check if resultcode is success when unique nexus is created
        public void CreateNexusTestToCheckIfResultCodeIsSuccessForUniqueNexus()
        {
            //Arrange
            var    companyResult = AccountServiceHelper.CreateCompany(createCompany, accountInfo, createCompanyController);
            int    companyID     = companyResult.CompanyId;
            string country       = "IN";
            string state         = "RJ";

            nexusController = new NexusSetupController();
            nexusController.TempData.Add("AccountInfo", accountInfo);
            nexusController.TempData.Add("AccountService", accountService);

            var Success = SeverityLevel.Success;

            //Act

            var actualResult = AccountServiceHelper.CreateNexus(country, state, companyID, nexusController);

            //Assert
            Assert.AreEqual(Success, actualResult[0].ResultCode, "resultcode must be success!!");
        }