static void Main(string[] args) { var cxmlFile = args.FirstOrDefault() ?? throw new Exception("A path to a cxml file is required."); var jsonFile = args.Skip(1).FirstOrDefault() ?? Path.ChangeExtension(cxmlFile, ".json"); var collection = PivotViewerCollection.LoadCxml(cxmlFile); collection.SaveJson(jsonFile); }
public void CanLoadCxml() { var collection = PivotViewerCollection.LoadCxml("msdnmagazine.cxml"); Assert.NotNull(collection); var itemWithId4 = collection.Items.First(i => i.Id == "4"); Assert.NotNull(itemWithId4); var titleFacet = itemWithId4.Facets.First(f => f.Name == "Title"); Assert.NotNull(titleFacet); Assert.Equal("Data Processing: Parallelism and Performance", titleFacet.Value); }