public void CanGetCurrencies()
        {
            var result = repo.GetCurrencies();

            Assert.That(result, Is.Not.Null);
            Assert.That(result.Entities.Count, Is.GreaterThan(1));
        }
Beispiel #2
0
        public void Execute()
        {
            trace.Trace(TraceEventType.Information, (int)EventId.StartingRateSync, "Syncing Rates");

            trace.Trace(TraceEventType.Information, (int)EventId.GettingRatesFromApi, "Getting Rates from API");
            var rates = rateService.GetRates(GetOrganisationUniqueName());

            trace.Trace(TraceEventType.Information, (int)EventId.GettingCurrenciesFromCrm, "Getting Currencies from CRM");
            var currencies = repo.GetCurrencies();

            trace.Trace(TraceEventType.Information, (int)EventId.SyncingCurrencies, "Sync Currencies with Latest Rate Date");
            currencies = rateSyncer.Sync(currencies, rates);

            trace.Trace(TraceEventType.Information, (int)EventId.SavingCurrencies, "Saving updated currencies to CRM");
            repo.SaveCurrencies(currencies);

            new JobCompleter(organisationService, config, trace).Complete(trace.HasWarnings
                                ? RunStatus.Warning
                                : RunStatus.Success);
        }