public void TestDocWithUnicodeProps() { using (TempFileForActions inputFile = new TempFileForActions(CopyFile(Workshare.TestUtils.TestFileUtils.MakeRootPathAbsolute(@"\Projects\Hygiene\src\TestDocuments\UnicodeCustomProps.doc")))) { LightSpeedWordCleaningStrategy strategy = new LightSpeedWordCleaningStrategy(); Type type = typeof(LightSpeedWordCleaningStrategy); MethodInfo mi = type.GetMethod("CleanFile", BindingFlags.NonPublic | BindingFlags.Instance); mi.Invoke( strategy, new object[3] { inputFile.TempFile, new List<ContentType>() { ContentType.ContentRule, ContentType.Comment, ContentType.TrackChange, ContentType.SmallText, ContentType.WhiteText, ContentType.HiddenText, ContentType.SmartTag, ContentType.Field, ContentType.RoutingSlip, ContentType.AttachedTemplate, ContentType.AutoVersion, ContentType.Version, ContentType.BuiltInProperty, ContentType.CustomProperty, ContentType.Variable }, new List<Exclusion>() } ); Assert.IsTrue(strategy.VerifyFileWithOffice(inputFile)); } }
public void TestVerifyFileWithOfficeWithCorruptFile() { using (TempFileForActions inputFile = new TempFileForActions(CopyFile(Workshare.TestUtils.TestFileUtils.MakeRootPathAbsolute(@"\Projects\Hygiene\src\TestDocuments\Corrupt.doc")))) { LightSpeedWordCleaningStrategy strategy = new LightSpeedWordCleaningStrategy(); Assert.IsFalse(strategy.VerifyFileWithOffice(inputFile), "Verification should fail"); } }
public void TestRemoveMacros() { using (TempFileForActions inputFile = new TempFileForActions(CopyFile(Workshare.TestUtils.TestFileUtils.MakeRootPathAbsolute(@"\Projects\Hygiene\src\TestDocuments\TestSimpleDocument.doc")))) { CleanActionPropertySet cleanActionProperties = new CleanActionPropertySet(); LightSpeedWordCleaningStrategy strategy = new LightSpeedWordCleaningStrategy(); strategy.RemoveMacros(inputFile, cleanActionProperties); } }