public void CsvReportTest()
        {
            string expected = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "movie.csv");

            if (File.Exists(expected))
            {
                File.Delete(expected);
            }

            Movie movie1 = new Movie();

            movie1.Name = "Oblivion";
            movie1.PaymentForTomCruise = 2000000M;

            Movie movie2 = new Movie();

            movie2.Name = "Edge of Tomorrow";
            movie2.PaymentForTomCruise = 3000000M;

            CompareLogic compareLogic = new CompareLogic();

            compareLogic.Config.MaxDifferences = Int32.MaxValue;
            ComparisonResult result = compareLogic.Compare(movie1, movie2);

            CsvReport csvReport = new CsvReport();

            csvReport.OutputFile(result.Differences, expected);

            Assert.IsTrue(File.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, expected)));

            csvReport.LaunchApplication(expected);
        }
Beispiel #2
0
        //[Test]
        public void CsvReportTest()
        {
            if (File.Exists("movie.csv"))
            {
                File.Delete("movie.csv");
            }

            Movie movie1 = new Movie();

            movie1.Name = "Oblivion";
            movie1.PaymentForTomCruise = 2000000M;

            Movie movie2 = new Movie();

            movie2.Name = "Edge of Tomorrow";
            movie2.PaymentForTomCruise = 3000000M;

            CompareLogic compareLogic = new CompareLogic();

            compareLogic.Config.MaxDifferences = Int32.MaxValue;
            ComparisonResult result = compareLogic.Compare(movie1, movie2);

            CsvReport csvReport = new CsvReport();

            csvReport.OutputFile(result.Differences, "movie.csv");

            Assert.IsTrue(File.Exists("movie.csv"));

            csvReport.LaunchApplication("movie.csv");
        }