Exemple #1
0
            public void ShouldWriteContentToFile()
            {
                // Arrange
                const string baseName = "fileName";
                const string fileName = "fileName.ext";
                const string expected = "hello world";
                var          sut      = new CsvData(expected, "ext");

                // Act
                sut.Save(baseName);

                // Assert
                var actual = File.ReadAllText(fileName);

                Assert.Equal(expected, actual);
            }
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            List <string> result = new List <string>();

            foreach (var account in dm1.accounts)
            {
                foreach (var currency in account.Value.currency)
                {
                    double diff = dm2.getValue(account.Key, currency.Key) - currency.Value;
                    if (diff != 0)
                    {
                        result.Add($"{account.Key}-{currency.Key} diff: {diff}");
                    }
                }
            }
            CsvData csD = new CsvData();

            csD.Save(@"C:\Users\Desktop\TaskChallenge\answer.XLSX", result);
            MessageBox.Show("Done");
        }