CSV Report

From Compare .NET Objects

Compare .NET Objects
CSV Report
Send Feedback
Using Compare .NET Objects > Reports > CSV Report

Glossary Item Box

CSV Report

The CSV Reports outputs the results to a comma separated value file.  The launch portion will open the file using whatever application is associated with the .csv extension.  Normally this is Excel.

Example

[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");
}

© Kellerman Software 2018. All Rights Reserved.