public void Export_ExportToTxt() { // arrange ISplitter splitter = new SplitterRss(); ItemNumericalSet set = ExcelParser.ParseItemNumericalSet(@"data\test-4x15.xlsx"); TreeBuilder builder = new TreeBuilder("F1", 5, new Lib.NameGenerator(), splitter); TreeGenerative tree = builder.Build(set); tree.ExportStrategy = new ExportToTxt(); DirectoryInfo di = new DirectoryInfo("temp"); if (!di.Exists) { di.Create(); } // act tree.Export(@"temp\test-4x15.txt"); // assert }
public void Export_ExportToJson() { // arrange string name = "test-2x90-sin"; ISplitter splitter = new SplitterRss(); ItemNumericalSet set = ExcelParser.ParseItemNumericalSet(string.Format(@"data\{0}.xlsx", name)); TreeBuilder builder = new TreeBuilder("Y", 5, new Lib.NameGenerator(), splitter); TreeGenerative tree = builder.Build(set); tree.ExportStrategy = new ExportToJson(); DirectoryInfo di = new DirectoryInfo("temp"); if (!di.Exists) { di.Create(); } // act tree.Export(string.Format(@"temp\{0}.json", name)); // assert }