Esempio n. 1
0
        /// <summary>
        /// Tests create view against two options with compare results
        /// </summary>
        private void TestCompareOptions(TestFile testFile, RenderOptions options1, RenderOptions options2)
        {
            var viewOptions1 = new ViewOptions
            {
                FileInfo      = testFile.ToFileInfo(),
                RenderOptions = options1
            };
            var viewResult1 = ViewApi.CreateView(new CreateViewRequest(viewOptions1));
            var response1   = FileApi.DownloadFile(new DownloadFileRequest {
                path = viewResult1.Pages[0].Path
            });

            Assert.Greater(response1.Length, 0);

            Cleanup();

            var viewOptions2 = new ViewOptions
            {
                FileInfo      = testFile.ToFileInfo(),
                RenderOptions = options2
            };
            var viewResult2 = ViewApi.CreateView(new CreateViewRequest(viewOptions2));
            var response2   = FileApi.DownloadFile(new DownloadFileRequest {
                path = viewResult2.Pages[0].Path
            });

            Assert.Greater(response2.Length, 0);

            Assert.AreNotEqual(response1.Length, response2.Length);
        }
Esempio n. 2
0
        protected UpdatesOptions GetComparisonOptionsUpdates(TestFile sourceFile, List <TestFile> targetFiles)
        {
            var options = new UpdatesOptions
            {
                SourceFile = sourceFile.ToFileInfo(),
                OutputPath = "/resultFilePath/" + sourceFile.FileName,
                Settings   = new Settings
                {
                    GenerateSummaryPage        = true,
                    ShowDeletedContent         = true,
                    StyleChangeDetection       = true,
                    UseFramesForDelInsElements = false,
                    MetaData                      = null,
                    DetailsLevel                  = Settings.DetailsLevelEnum.Low,
                    DiagramMasterSetting          = null,
                    CalculateComponentCoordinates = false,
                    CloneMetadata                 = Settings.CloneMetadataEnum.Default,
                    Password                      = "******",
                    PasswordSaveOption            = Settings.PasswordSaveOptionEnum.User,
                    DeletedItemsStyle             = new ItemsStyle
                    {
                        BeginSeparatorString = "",
                        EndSeparatorString   = "",
                        FontColor            = "16711680",
                        HighlightColor       = "16711680",
                        Bold          = false,
                        Italic        = false,
                        StrikeThrough = false
                    },
                    InsertedItemsStyle = new ItemsStyle
                    {
                        BeginSeparatorString = "",
                        EndSeparatorString   = "",
                        FontColor            = "255",
                        HighlightColor       = "255",
                        Bold          = false,
                        Italic        = false,
                        StrikeThrough = false
                    },
                    ChangedItemsStyle = new ItemsStyle
                    {
                        BeginSeparatorString = "",
                        EndSeparatorString   = "",
                        FontColor            = "65280",
                        HighlightColor       = "65280",
                        Bold          = false,
                        Italic        = false,
                        StrikeThrough = false
                    },
                },
            };

            var targets = new List <FileInfo>();

            foreach (var targetFile in targetFiles)
            {
                targets.Add(targetFile.ToFileInfo());
            }
            options.TargetFiles = targets.ToList();


            var changes = new List <ChangeInfo>
            {
                new ChangeInfo {
                    Id = 0, ComparisonAction = ChangeInfo.ComparisonActionEnum.Accept
                },
                new ChangeInfo {
                    Id = 1, ComparisonAction = ChangeInfo.ComparisonActionEnum.Reject
                }
            };

            options.Changes = changes.ToList();

            return(options);
        }