public TaxModuleTest()
 {
     _controller = GetTaxController();
 }
        private static AvaTaxController GetTaxController()
        {
            var avalaraUsername = "******";
            var avalaraPassword = "******";
            var avalaraServiceUrl = "https://development.avalara.net";
            var avalaraCompanyCode = "APITrialCompany";
            
            const string _usernamePropertyName = "Avalara.Tax.Credentials.AccountNumber";
            const string _passwordPropertyName = "Avalara.Tax.Credentials.LicenseKey";
            const string _serviceUrlPropertyName = "Avalara.Tax.Credentials.ServiceUrl";
            const string _companyCodePropertyName = "Avalara.Tax.Credentials.CompanyCode";
            const string _isEnabledPropertyName = "Avalara.Tax.IsEnabled";
            const string _isValidateAddressPropertyName = "Avalara.Tax.IsValidateAddress";

            var settings = new List<SettingEntry>
            {
                new SettingEntry
                {
                    Value = avalaraUsername,
                    Name = _usernamePropertyName,
                    ValueType = SettingValueType.ShortText
                },
                new SettingEntry
                {
                    Value = avalaraPassword,
                    Name = _passwordPropertyName,
                    ValueType = SettingValueType.ShortText
                },
                new SettingEntry
                {
                    Value = avalaraServiceUrl,
                    Name = _serviceUrlPropertyName,
                    ValueType = SettingValueType.ShortText
                },
                new SettingEntry
                {
                    Value = avalaraCompanyCode,
                    Name = _companyCodePropertyName,
                    ValueType = SettingValueType.ShortText
                },
                new SettingEntry { Value = "True", Name = _isEnabledPropertyName, ValueType = SettingValueType.Boolean }
            };

            var settingsManager = new Moq.Mock<ISettingsManager>();

            settingsManager.Setup(manager => manager.GetValue(_usernamePropertyName, string.Empty)).Returns(() => settings.First(x => x.Name == _usernamePropertyName).Value);
            settingsManager.Setup(manager => manager.GetValue(_passwordPropertyName, string.Empty)).Returns(() => settings.First(x => x.Name == _passwordPropertyName).Value);
            settingsManager.Setup(manager => manager.GetValue(_serviceUrlPropertyName, string.Empty)).Returns(() => settings.First(x => x.Name == _serviceUrlPropertyName).Value);
            settingsManager.Setup(manager => manager.GetValue(_companyCodePropertyName, string.Empty)).Returns(() => settings.First(x => x.Name == _companyCodePropertyName).Value);
            settingsManager.Setup(manager => manager.GetValue(_isEnabledPropertyName, true)).Returns(() => true);
            settingsManager.Setup(manager => manager.GetValue(_isValidateAddressPropertyName, true)).Returns(() => true);
            
            var avalaraTax = new AvaTaxSettings(_usernamePropertyName, _passwordPropertyName, _serviceUrlPropertyName, _companyCodePropertyName, _isEnabledPropertyName, _isValidateAddressPropertyName, settingsManager.Object);

            var controller = new AvaTaxController(avalaraTax);
            return controller;
        }