Exemplo n.º 1
0
        public decimal Calculate(decimal donation, string eventType)
        {
            decimal taxRate = _configProvider.GetConfiguration().TaxRate;

            decimal originalAmount = donation * (taxRate / (100 - taxRate));

            decimal supplement = get_supplement_for_event_type(eventType);

            return(originalAmount + (originalAmount * supplement));
        }
        public void ReadConfigurationAndCheckResult()
        {
            var credentialConfig = _provideConfiguration.GetConfiguration <CredentialConfigSection>("credentialSection");
            int iIdx             = 0;

            credentialConfig.Should().NotBeNull("Credential definition is in the App.config");

            foreach (CredentialConfig credential in credentialConfig.Credentials)
            {
                credential.Target.Should().Be(_targetList[iIdx]);
                credential.User.Should().Be(_userList[iIdx]);
                credential.Password.Should().Be(_passwordList[iIdx]);
                credential.Type.Should().Be(_typeList[iIdx]);
                credential.Persist.Should().Be(_persistList[iIdx]);

                iIdx++;
            }
        }
Exemplo n.º 3
0
        public void ConstructModules(int streamType)
        {
            _configSection = _provideConfiguration.GetConfiguration <ModuleWiringConfigSection.ModuleWiringConfigSection>("moduleWiring" + streamType);
            _streamType    = streamType;

            CreateModules(_configSection, streamType);

            foreach (var factory in _usedFactories)
            {
                factory.TriggerContainerRecomposition();
            }

            CreateGraphAndWireUp();

            Construct(streamType);

            CreateDependencies();

            EventAggregator.Publish(new AllModulesCreatedEvent());
        }
Exemplo n.º 4
0
        public INotifier Create(IEnvelope queueItem)
        {
            var sendGridApiKey = _cfgProvider.GetConfiguration("sendgrid-api-key");

            return(new SendGridNotifyPickIsAvalable(sendGridApiKey));
        }
Exemplo n.º 5
0
 public CustomFaultManager(ISendMessages sender, IProvideConfiguration <MessageForwardingInCaseOfFaultConfig> config)
 {
     this.sender = sender;
     this.config = config.GetConfiguration();
 }