Exemple #1
0
        public void ParsesDataCorrectly()
        {
            var countryCodeHelper = new CountryCodeHelper(Seed.Countries);
            var fxStreet          = new fx.FXStreet(countryCodeHelper);
            var errors            = new List <string>();

            ((IEconomicReleaseSource)fxStreet).Error += (s, e) => errors.Add(e.ErrorMessage);

            var items = fxStreet.parseData(_data);

            foreach (string error in errors)
            {
                TestContext.WriteLine(error);
            }

            Assert.AreEqual(0, errors.Count);
            Assert.AreEqual(88, items.Count);
            Assert.IsFalse(items.Any(x => string.IsNullOrEmpty(x.Country)));
            Assert.IsFalse(items.Any(x => string.IsNullOrEmpty(x.Currency)));
            var allNulls = items.FirstOrDefault(x => x.Name == "BOE's Governor Carney speech");

            Assert.AreEqual(null, allNulls.Previous);
            Assert.AreEqual(null, allNulls.Actual);
            Assert.AreEqual(null, allNulls.Expected);

            Assert.AreEqual(1.25, items[1].Previous);
            Assert.AreEqual(1.25, items[1].Actual);
            Assert.AreEqual(1.25, items[1].Expected.Value);
        }
Exemple #2
0
        public void ParsesDataCorrectly()
        {
            var countryCodeHelper = new CountryCodeHelper(Seed.Countries);
            var fxStreet = new fx.FXStreet(countryCodeHelper);
            var errors = new List<string>();
            ((IEconomicReleaseSource)fxStreet).Error += (s, e) => errors.Add(e.ErrorMessage);

            var items = fxStreet.parseData(_data);

            foreach (string error in errors)
            {
                TestContext.WriteLine(error);
            }

            Assert.AreEqual(0, errors.Count);
            Assert.AreEqual(88, items.Count);
            Assert.IsFalse(items.Any(x => string.IsNullOrEmpty(x.Country)));
            Assert.IsFalse(items.Any(x => string.IsNullOrEmpty(x.Currency)));
            var allNulls = items.FirstOrDefault(x => x.Name == "BOE's Governor Carney speech");
            Assert.AreEqual(null, allNulls.Previous);
            Assert.AreEqual(null, allNulls.Actual);
            Assert.AreEqual(null, allNulls.Expected);

            Assert.AreEqual(1.25, items[1].Previous);
            Assert.AreEqual(1.25, items[1].Actual);
            Assert.AreEqual(1.25, items[1].Expected.Value);
        }