Exemplo n.º 1
0
        public void CountrySubdivisionRepository_AddValue()
        {
            var repo = new CountrySubdivisionRepository();

            var key          = "AAA";
            var subdivisions = new List <SubdivisionInfo>
            {
                new SubdivisionInfo
                {
                    CountrySubdivisionCode = "AAA-1",
                    CountrySubdivisionName = "AAA 1"
                },
                new SubdivisionInfo
                {
                    CountrySubdivisionCode = "AAA-2",
                    CountrySubdivisionName = "AAA 2"
                }
            };

            repo.AddValue(key, subdivisions);

            var value       = repo.GetValue <List <SubdivisionInfo> >(key);
            var containsKey = repo.ContainsKey(key);

            Assert.IsNotNull(value);
            Assert.IsTrue(containsKey);
            Assert.AreEqual(2, value.Count);
        }
 /// <summary>
 ///     Instantiates a new AddAgentViewModel.
 /// </summary>
 /// <param name="settingsSvc"></param>
 /// <param name="messageBus"></param>
 public AgentManagementViewModel(ISettingsSvc settingsSvc, IMessageBus messageBus)
 {
     _settingsSvc                  = settingsSvc;
     _messageBus                   = messageBus;
     _countryRepository            = new CountryRepository();
     _countrySubdivisionRepository = new CountrySubdivisionRepository();
     _currencyRepository           = new CurrencyRepository();
 }
Exemplo n.º 3
0
 //private List<string> _delimitedStates = new List<string> { AgentLocation.MN, AgentLocation.NY, AgentLocation.OK, AgentLocation.OR, AgentLocation.FL };
 /// <summary>
 ///
 /// </summary>
 /// <param name="messageBus"></param>
 /// <param name="settingsSvc"></param>
 public StagedBillPayViewModel(ISettingsSvc settingsSvc, IMessageBus messageBus)
     : base(messageBus)
 {
     _messageBus                   = messageBus;
     _settingsSvc                  = settingsSvc;
     _countryRepository            = new CountryRepository();
     _countrySubdivisionRepository = new CountrySubdivisionRepository();
     _amountRangeRepository        = new AmountRangeRepository();
 }
Exemplo n.º 4
0
        public void CountrySubdivisionRepository_GetAllValues()
        {
            var repo = new CountrySubdivisionRepository();

            var values = repo.GetAllValues <List <CountrySubdivisionInfo> >();

            Assert.IsNotNull(values);
            Assert.IsTrue(values.Count > 0);
        }
Exemplo n.º 5
0
        public void CountrySubdivisionRepository_GetValue()
        {
            var repo = new CountrySubdivisionRepository();

            var value = repo.GetValue <List <SubdivisionInfo> >("USA");

            Assert.IsNotNull(value);
            Assert.AreEqual(51, value.Count);
        }
Exemplo n.º 6
0
        public void CountrySubdivisionRepository_Search_Subdivision()
        {
            var repo = new CountrySubdivisionRepository();

            var searchTerm = "minnesota";

            var values = repo.Search <List <CountrySubdivisionInfo> >(searchTerm);

            Assert.IsNotNull(values);
            Assert.IsTrue(values.Count > 0);
        }
Exemplo n.º 7
0
        public void CountrySubdivisionRepository_RemoveValue()
        {
            var repo = new CountrySubdivisionRepository();

            var key = "CAN";

            repo.RemoveValue(key);

            var containsKey = repo.ContainsKey(key);

            Assert.IsFalse(containsKey);
        }
Exemplo n.º 8
0
 /// <summary>
 ///     Instantiates a new Send Reversal Parameters View Model.
 /// </summary>
 /// <param name="settingsSvc"></param>
 /// <param name="messageBus"></param>
 public SendReversalParametersViewModel(ISettingsSvc settingsSvc, IMessageBus messageBus)
     : base(messageBus)
 {
     _settingsSvc                  = settingsSvc;
     _messageBus                   = messageBus;
     _countryRepository            = new CountryRepository();
     _countrySubdivisionRepository = new CountrySubdivisionRepository();
     _currencyRepository           = new CurrencyRepository();
     _amountRangeRepository        = new AmountRangeRepository();
     _feeTypeRepository            = new FeeTypeRepository();
     _serviceOptionRepository      = new ServiceOptionRepository();
     _refundReasonRepository       = new RefundReasonRepository();
 }
Exemplo n.º 9
0
 /// <summary>
 ///     Create this viewmodel with settings provided by given settingsSvc
 /// </summary>
 /// <param name="settingsSvc">Settings service</param>
 /// <param name="messageBus"></param>
 public ReceiveViewModel(ISettingsSvc settingsSvc, IMessageBus messageBus)
     : base(messageBus)
 {
     _settingsSvc                  = settingsSvc;
     _countryRepository            = new CountryRepository();
     _countrySubdivisionRepository = new CountrySubdivisionRepository();
     _currencyRepository           = new CurrencyRepository();
     _amountRangeRepository        = new AmountRangeRepository();
     _feeTypeRepository            = new FeeTypeRepository();
     _serviceOptionRepository      = new ServiceOptionRepository();
     _messageBus = messageBus;
     _messageBus.Subscribe <ProductChangeEvent>(ProductChanged);
     _messageBus.Subscribe <AgentLocationChangedEvent>(AgentLocationChanged);
 }
 /// <summary>
 ///     Create this viewmodel with settings provided by given settingsSvc
 /// </summary>
 /// <param name="settingsSvc">Settings service</param>
 /// <param name="messageBus"></param>
 /// <param name="transactionName"></param>
 public SendParametersViewModel(ISettingsSvc settingsSvc, IMessageBus messageBus, string transactionName)
     : base(messageBus)
 {
     _settingsSvc                  = settingsSvc;
     _countryRepository            = new CountryRepository();
     _countrySubdivisionRepository = new CountrySubdivisionRepository();
     _currencyRepository           = new CurrencyRepository();
     _amountRangeRepository        = new AmountRangeRepository();
     _feeTypeRepository            = new FeeTypeRepository();
     _serviceOptionRepository      = new ServiceOptionRepository();
     _messageBus      = messageBus;
     _transactionName = transactionName;
     _messageBus.Subscribe <ProductChangeEvent>(ProductChanged);
 }
Exemplo n.º 11
0
        public void CountrySubdivisionRepository_UpdateValue()
        {
            var repo = new CountrySubdivisionRepository();

            var key         = "MEX";
            var subdivisons = new List <SubdivisionInfo>
            {
                new SubdivisionInfo
                {
                    CountrySubdivisionCode = "MX-BCN",
                    CountrySubdivisionName = "Baja California"
                }
            };

            repo.UpdateValue(key, subdivisons);

            var value       = repo.GetValue <List <SubdivisionInfo> >(key);
            var containsKey = repo.ContainsKey(key);

            Assert.IsNotNull(value);
            Assert.IsTrue(containsKey);
            Assert.AreEqual(1, value.Count);
            Assert.AreEqual("MX-BCN", value.FirstOrDefault()?.CountrySubdivisionCode);
        }