public void OpenXMLLoadTemplate()
        {
            var fileSystemConnector = new FileSystemConnector(
                    String.Format(@"{0}\..\..\Resources",
                    AppDomain.CurrentDomain.BaseDirectory),
                    "Templates");

            var openXMLConnector = new OpenXMLConnector(packageFileName,
                fileSystemConnector);

            var templateFile = openXMLConnector.GetFileStream("ProvisioningSchema-2015-12-FullSample-02.xml");

            XMLPnPSchemaV201512Formatter formatter = new XMLPnPSchemaV201512Formatter();
            Boolean checkTemplate = formatter.IsValid(templateFile);

            Assert.IsTrue(checkTemplate);

            var image1 = openXMLConnector.GetFileStream("garagelogo.png", "Images");
            Assert.IsNotNull(image1);

            var image2 = openXMLConnector.GetFileStream("garagelogo.png", "Images");
            Assert.IsNotNull(image2);
        }
        public void OpenXMLDeleteFileFromTemplate()
        {
            var fileSystemConnector = new FileSystemConnector(
                    String.Format(@"{0}\..\..\Resources",
                    AppDomain.CurrentDomain.BaseDirectory),
                    "Templates");

            var openXMLConnector = new OpenXMLConnector(packageFileName,
                fileSystemConnector);

            openXMLConnector.DeleteFile("garagelogo.png", "Images");

            var image1 = openXMLConnector.GetFileStream("garagelogo.png", "Images");
            Assert.IsNull(image1);
        }
 public void OpenXMLGetFileFromTemplate()
 {
     var fileSystemConnector = new FileSystemConnector(String.Format(@"{0}\..\..\Resources", AppDomain.CurrentDomain.BaseDirectory), "Templates");
     var openXMLConnector = new OpenXMLConnector(packageFileName, fileSystemConnector);
     var file = openXMLConnector.GetFile("garagebg.jpg");
     Assert.IsNull(file);
     file = openXMLConnector.GetFile("garagebg.jpg", "Images");
     Assert.IsNotNull(file);
     Stream stream = openXMLConnector.GetFileStream("garagebg.jpg");
     Assert.IsNull(stream);
     stream = openXMLConnector.GetFileStream("garagebg.jpg", "Images");
     Assert.IsNotNull(stream.Length > 0);
 }