public void TestMethod1() { using var stream = new MemoryStream(Encoding.ASCII.GetBytes(NbpTestFile)); var dataFile = BossaDataFile.CreateBossaFile <BossaCurrentNbpCurrenciesDataFile>(stream); Assert.AreEqual(3, dataFile.Data.Count()); Assert.IsNotNull(dataFile.Data.Single(q => q.Currency == "EUR" && q.Date == new DateTime(2020, 9, 30) && q.Price == 4.5268m)); Assert.IsNotNull(dataFile.Data.Single(q => q.Currency == "GBP" && q.Date == new DateTime(2020, 9, 30) && q.Price == 4.9560m)); Assert.IsNotNull(dataFile.Data.Single(q => q.Currency == "USD" && q.Date == new DateTime(2020, 9, 30) && q.Price == 3.8658m)); }
public void TestMethod1() { using var stream = new MemoryStream(Encoding.ASCII.GetBytes(TestFile)); var dataFile = BossaDataFile.CreateBossaFile <BossaCurrentInvestmentFundsDataFile>(stream); Assert.AreEqual(3, dataFile.Data.Count()); Assert.IsNotNull(dataFile.Data.Single(q => q.FundSymbol == "AGI004" && q.Date == new DateTime(2020, 9, 25) && q.Price == 130.5600m)); Assert.IsNotNull(dataFile.Data.Single(q => q.FundSymbol == "AGI043" && q.Date == new DateTime(2020, 9, 25) && q.Price == 100.9700m)); Assert.IsNotNull(dataFile.Data.Single(q => q.FundSymbol == "AGI044" && q.Date == new DateTime(2020, 9, 25) && q.Price == 116.7500m)); }
public void TestMethod1() { using var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("BossaWebsite.Tests.mstnbp.zip"); var dataFile = BossaDataFile.CreateBossaFile <BossaHistoricNbpCurrenciesDataFile>(stream); Assert.AreEqual(3, dataFile.Data.Count); Assert.IsNotNull(dataFile.Data["EUR"].Single(q => q.Date == new DateTime(1999, 01, 01) && q.Price == 4.0925m)); Assert.IsNotNull(dataFile.Data["GBP"].Single(q => q.Date == new DateTime(1993, 01, 05) && q.Price == 2.3892m)); Assert.IsNotNull(dataFile.Data["USD"].Single(q => q.Date == new DateTime(1993, 01, 06) && q.Price == 1.5912m)); }