Exemplo n.º 1
0
        public void AddCompanyInformationTest()
        {
            var testCompany = GetTestCompanyAU();

            var dict = new Dictionary <string, string>();

            SalesService.AddCompanyInformation(testCompany, dict);

            // Check that each property has been added to the list
            isEqual(dict, "SITEFOLDER", GetAppSetting("SiteFolder", ""));
            isEqual(dict, "LOGOIMAGE", GetAppSetting("SiteFolder", "") + @"\Content\Logos\" + testCompany.FormLogo);
            isEqual(dict, "COMPANYNAME", testCompany.CompanyName);
            isEqual(dict, "ABN", testCompany.ABN);
            isEqual(dict, "COMPANYADDRESS", testCompany.CompanyAddress);
            isEqual(dict, "PHONENUMBER", testCompany.PhoneNumber);
            isEqual(dict, "FAXNUMBER", testCompany.FaxNumber);
            isEqual(dict, "WEBSITE", testCompany.Website);
            isEqual(dict, "BANKNAME", testCompany.BankName);
            isEqual(dict, "ACCOUNTNAME", testCompany.AccountName);
            isEqual(dict, "ACCOUNTNUMBER", testCompany.AccountNumber);
            isEqual(dict, "ACCOUNTBSB", testCompany.AccountBSB);
            isEqual(dict, "SWIFT", (string.IsNullOrEmpty(testCompany.Swift) ? "" : testCompany.Swift));
            isEqual(dict, "BRANCH", (string.IsNullOrEmpty(testCompany.Branch) ? "" : testCompany.Branch));

            double surcharge = (testCompany.AmexSurcharge == null ? 0 : testCompany.AmexSurcharge.Value);

            isEqual(dict, "AMEXSURCHARGE", (surcharge * 100).ToString("N2"));

            surcharge = (testCompany.VisaSurcharge == null ? 0 : testCompany.VisaSurcharge.Value);
            isEqual(dict, "VISASURCHARGE", (surcharge * 100).ToString("N2"));

            surcharge = (testCompany.MCSurcharge == null ? 0 : testCompany.MCSurcharge.Value);
            isEqual(dict, "MCSURCHARGE", (surcharge * 100).ToString("N2"));

            isEqual(dict, "EMAILADDRESSPURCHASING", testCompany.EmailAddressPurchasing);
            isEqual(dict, "EMAILADDRESSSALES", testCompany.EmailAddressSales);
            isEqual(dict, "EMAILADDRESSACCOUNTS", testCompany.EmailAddressAccounts);
        }