Ejemplo n.º 1
0
            public void WhenDocumentHasSingleHeadlineNoContent_ThenShredDocumentsCreatesDocuments()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\SingleHeadlineNoContent.doc"), string.Empty, string.Empty);

                VerifyDocuments(this.processor.GenerateWorkflowDocuments(this.shredDirectory), this.shredDirectory, null);
            }
Ejemplo n.º 2
0
 public void WhenDocumentHasNoTitle_ThenCalculateWorkflowThrows()
 {
     this.processor = new TocGuidanceProcessor(
         PathTo("SampleGuidanceDocs\\NotStartingWithTitle.doc"), string.Empty, string.Empty);
     Assert.Throws <InvalidOperationException>(() =>
                                               this.processor.CalculateWorkflow());
 }
Ejemplo n.º 3
0
            public void WhenDocumentHasMultipleTopLevelHeadlines_ThenShredDocumentsCreatesDocuments()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\MultipleTopLevelHeadlines.doc"), string.Empty, string.Empty);

                VerifyDocuments(this.processor.GenerateWorkflowDocuments(this.shredDirectory), this.shredDirectory, null);
            }
 public void WhenDocumentHasNoTitle_ThenCalculateWorkflowThrows()
 {
     this.processor = new TocGuidanceProcessor(
         PathTo("SampleGuidanceDocs\\NotStartingWithTitle.doc"), string.Empty, string.Empty);
     Assert.Throws<InvalidOperationException>(() =>
         this.processor.CalculateWorkflow());
 }
Ejemplo n.º 5
0
            public void WhenDocumentHasOnlyTitle_ThenValidateDocumentsSucceeds()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\JustTitleNoPages.doc"), string.Empty, string.Empty);

                VerifyValidationErrors(this.processor.ValidateDocument());
            }
Ejemplo n.º 6
0
            public void WhenDocumentHasMultipleHeadlinesAndTopics_ThenValidateDocumentsSucceeds()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\MultipleHeadlinesAndTopics.doc"), string.Empty, string.Empty);

                VerifyValidationErrors(this.processor.ValidateDocument());
            }
Ejemplo n.º 7
0
            public void WhenDocumentHasSingleTopic_ThenValidateDocumentsSucceeds()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\SingleTopic.doc"), string.Empty, string.Empty);

                VerifyValidationErrors(this.processor.ValidateDocument());
            }
Ejemplo n.º 8
0
            public void WhenDocumentHasMultipleTopicsAndHeadlinesWithDuplicates_ThenValidateDocumentsFails()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\MultipleTopicsAndHeadlinesWithDuplicates.doc"), "FooFeatureId", "Assets/Guidance/Content");

                VerifyValidationErrors(this.processor.ValidateDocument(), 1);
            }
Ejemplo n.º 9
0
            public void WhenDocumentHasOneHeadlineWithHyperlinkToTopic_ThenValidateDocumentsSucceeds()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\OneHeadlineWithHyperlinkToTopic.doc"), "FooFeatureId", "Assets/Guidance/Content");

                VerifyValidationErrors(this.processor.ValidateDocument());
            }
Ejemplo n.º 10
0
            public void WhenDocumentHasTwoTopicsWithHyperlinkToContent_ThenValidateDocumentsFails()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\TwoTopicsWithHyperlinkToContent.doc"), "FooFeatureId", "Assets/Guidance/Content");

                VerifyValidationErrors(this.processor.ValidateDocument(), 1);
            }
Ejemplo n.º 11
0
            public void WhenDocumentHasOnlyTitle_ThenShredDocumentsCreatesDocuments()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\JustTitleNoPages.doc"), string.Empty, string.Empty);

                VerifyDocuments(this.processor.GenerateWorkflowDocuments(this.shredDirectory), this.shredDirectory, null);
            }
Ejemplo n.º 12
0
 public void WhenDocumentHasNoTitle_ThenShredDocumentsThrows()
 {
     this.processor = new TocGuidanceProcessor(
         PathTo("SampleGuidanceDocs\\NotStartingWithTitle.doc"), string.Empty, string.Empty);
     Assert.Throws <InvalidOperationException>(() =>
                                               this.processor.GenerateWorkflowDocuments(this.shredDirectory));
 }
Ejemplo n.º 13
0
            public void WhenDocumentHasMultipleTopicsAndHeadlinesWithDuplicates_ThenShredDocumentsThrows()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\MultipleTopicsAndHeadlinesWithDuplicates.doc"), "FooFeatureId", "Assets/Guidance/Content");

                Assert.Throws <InvalidOperationException>(() =>
                                                          this.processor.GenerateWorkflowDocuments(this.shredDirectory));
            }
Ejemplo n.º 14
0
            public void WhenDocumentHasTwoTopicsWithHyperlinkToContent_ThenShredDocumentsThrows()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\TwoTopicsWithHyperlinkToContent.doc"), "FooFeatureId", "Assets/Guidance/Content");

                Assert.Throws <InvalidOperationException>(() =>
                                                          this.processor.GenerateWorkflowDocuments(this.shredDirectory));
            }
        /// <summary>
        /// Initializes a new instance of the <see cref="TocProcessWorkflowController"/> class.
        /// </summary>
        public TocProcessWorkflowController(TocProcessWorkflowTextTransformation template, string documentPath, string vsixId, string contentPath)
        {
            Guard.NotNull(() => template, template);
            Guard.NotNull(() => documentPath, documentPath);
            Guard.NotNull(() => vsixId, vsixId);
            Guard.NotNull(() => contentPath, contentPath);

            this.processor = new TocGuidanceProcessor(documentPath, vsixId, contentPath);
            this.template = template;
        }
Ejemplo n.º 16
0
            public void WhenDocumentHasSingleTopic_ThenShredDocumentsCreatesDocuments()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\SingleTopic.doc"), string.Empty, string.Empty);

                VerifyDocuments(this.processor.GenerateWorkflowDocuments(this.shredDirectory), this.shredDirectory, new[]
                {
                    "FirstTopic.MHT",
                });
            }
Ejemplo n.º 17
0
            public void WhenDocumentHasOneHeadlineWithHyperlinkToTopic_ThenShredDocumentsCreatesDocuments()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\OneHeadlineWithHyperlinkToTopic.doc"), "FooFeatureId", "Assets/Guidance/Content");

                VerifyDocuments(this.processor.GenerateWorkflowDocuments(this.shredDirectory), this.shredDirectory, new[]
                {
                    "SecondTopic.MHT",
                });
            }
Ejemplo n.º 18
0
            public void WhenDocumentHasOnlyTitle_ThenCalculateWorkflowCreatesAWorkflow()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\JustTitleNoPages.doc"), string.Empty, string.Empty);

                VerifyQueue(this.processor.CalculateWorkflow(), new[]
                    {
                        typeof(Initial),
                        typeof(GuidanceAction),
                        typeof(Final),
                    });
            }
Ejemplo n.º 19
0
            public void WhenDocumentHasMultipleHeadlinesAndTopics_ThenShredDocumentsCreatesDocuments()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\MultipleHeadlinesAndTopics.doc"), string.Empty, string.Empty);

                VerifyDocuments(this.processor.GenerateWorkflowDocuments(this.shredDirectory), this.shredDirectory, new[]
                {
                    "SecondTopic.MHT",
                    "ThirdTopic.MHT",
                    "FifthTopic.MHT",
                });
            }
Ejemplo n.º 20
0
            public void WhenDocumentHasOnlyTitle_ThenCalculateWorkflowCreatesAWorkflow()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\JustTitleNoPages.doc"), string.Empty, string.Empty);

                VerifyQueue(this.processor.CalculateWorkflow(), new[]
                {
                    typeof(Initial),
                    typeof(GuidanceAction),
                    typeof(Final),
                });
            }
Ejemplo n.º 21
0
            public void WhenDocumentHasSingleHeadline_ThenCalculateWorkflowCreatesAWorkflow()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\SingleHeadlineSingleLine.doc"), string.Empty, string.Empty);

                VerifyQueue(this.processor.CalculateWorkflow(), new[]
                {
                    typeof(Initial),
                    typeof(Fork),
                    typeof(GuidanceAction),
                    typeof(Join),
                    typeof(Final),
                });
            }
Ejemplo n.º 22
0
            public void WhenDocumentHasSingleHeadline_ThenCalculateWorkflowCreatesAWorkflow()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\SingleHeadlineSingleLine.doc"), string.Empty, string.Empty);

                VerifyQueue(this.processor.CalculateWorkflow(), new[]
                    {
                        typeof(Initial),
                        typeof(Fork),
                        typeof(GuidanceAction),
                        typeof(Join),
                        typeof(Final),
                    });
            }
Ejemplo n.º 23
0
            public void WhenDocumentHasTwoTopicsWithHyperlinksToThirdTopic_ThenShredDocumentsCreatesDocuments()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\TwoTopicsWithHyperlinksToThirdTopic.doc"), "FooFeatureId", "Assets/Guidance/Content");

                VerifyDocuments(this.processor.GenerateWorkflowDocuments(this.shredDirectory), this.shredDirectory, new[]
                {
                    "FirstTopic.MHT",
                    "SecondTopic.MHT",
                    "ThirdTopic.MHT",
                });
                VerifyDocumentContent(this.shredDirectory, "FirstTopic.MHT", new[]
                {
                    "content://FooFeatureId/Assets/Guidance/Content/SecondTopic.MHT"
                });
                VerifyDocumentContent(this.shredDirectory, "ThirdTopic.MHT", new[]
                {
                    "content://FooFeatureId/Assets/Guidance/Content/SecondTopic.MHT"
                });
            }
Ejemplo n.º 24
0
 public void WhenDocumentEmpty_ThenValidateDocumentsFails()
 {
     this.processor = new TocGuidanceProcessor(
         PathTo("SampleGuidanceDocs\\EmptyDocument.doc"), string.Empty, string.Empty);
     VerifyValidationErrors(this.processor.ValidateDocument(), 1);
 }
Ejemplo n.º 25
0
            public void WhenDocumentHasOneHeadlineWithHyperlinkToTopic_ThenShredDocumentsCreatesDocuments()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\OneHeadlineWithHyperlinkToTopic.doc"), "FooFeatureId", "Assets/Guidance/Content");

                VerifyDocuments(this.processor.GenerateWorkflowDocuments(this.shredDirectory), this.shredDirectory, new[]
                {
                    "SecondTopic.MHT",
                });
            }
Ejemplo n.º 26
0
            public void WhenDocumentHasTwoTopicsWithHyperlinksToThirdTopic_ThenShredDocumentsCreatesDocuments()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\TwoTopicsWithHyperlinksToThirdTopic.doc"), "FooFeatureId", "Assets/Guidance/Content");

                VerifyDocuments(this.processor.GenerateWorkflowDocuments(this.shredDirectory), this.shredDirectory, new[]
                {
                    "FirstTopic.MHT",
                    "SecondTopic.MHT",
                    "ThirdTopic.MHT",
                });
                VerifyDocumentContent(this.shredDirectory, "FirstTopic.MHT", new[] 
                { 
                    "content://FooFeatureId/Assets/Guidance/Content/SecondTopic.MHT" 
                });
                VerifyDocumentContent(this.shredDirectory, "ThirdTopic.MHT", new[] 
                { 
                    "content://FooFeatureId/Assets/Guidance/Content/SecondTopic.MHT" 
                });
            }
Ejemplo n.º 27
0
 public void WhenDocumentEmpty_ThenValidateDocumentsFails()
 {
     this.processor = new TocGuidanceProcessor(
         PathTo("SampleGuidanceDocs\\EmptyDocument.doc"), string.Empty, string.Empty);
     VerifyValidationErrors(this.processor.ValidateDocument(), 1);
 }
Ejemplo n.º 28
0
 public void WhenDocumentHasNoTitle_ThenValidateDocumentsFails()
 {
     this.processor = new TocGuidanceProcessor(
         PathTo("SampleGuidanceDocs\\NotStartingWithTitle.doc"), string.Empty, string.Empty);
     VerifyValidationErrors(this.processor.ValidateDocument(), 1);
 }
Ejemplo n.º 29
0
            public void WhenDocumentHasTwoTopicsWithHyperlinkToContent_ThenValidateDocumentsFails()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\TwoTopicsWithHyperlinkToContent.doc"), "FooFeatureId", "Assets/Guidance/Content");

                VerifyValidationErrors(this.processor.ValidateDocument(), 1);
            }
Ejemplo n.º 30
0
            public void WhenDocumentHasMultipleTopicsAndHeadlinesWithDuplicates_ThenShredDocumentsThrows()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\MultipleTopicsAndHeadlinesWithDuplicates.doc"), "FooFeatureId", "Assets/Guidance/Content");

                Assert.Throws<InvalidOperationException>(() =>
                    this.processor.GenerateWorkflowDocuments(this.shredDirectory));
            }
Ejemplo n.º 31
0
            public void WhenDocumentHasSingleTopic_ThenShredDocumentsCreatesDocuments()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\SingleTopic.doc"), string.Empty, string.Empty);

                VerifyDocuments(this.processor.GenerateWorkflowDocuments(this.shredDirectory), this.shredDirectory, new[]
                {
                    "FirstTopic.MHT",
                });
            }
Ejemplo n.º 32
0
            public void WhenDocumentHasOnlyTitle_ThenShredDocumentsCreatesDocuments()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\JustTitleNoPages.doc"), string.Empty, string.Empty);

                VerifyDocuments(this.processor.GenerateWorkflowDocuments(this.shredDirectory), this.shredDirectory, null);
            }
Ejemplo n.º 33
0
            public void WhenDocumentHasMultipleHeadlinesAndTopics_ThenShredDocumentsCreatesDocuments()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\MultipleHeadlinesAndTopics.doc"), string.Empty, string.Empty);

                VerifyDocuments(this.processor.GenerateWorkflowDocuments(this.shredDirectory), this.shredDirectory, new[]
                {
                    "SecondTopic.MHT",
                    "ThirdTopic.MHT",
                    "FifthTopic.MHT",
                });
            }
Ejemplo n.º 34
0
            public void WhenDocumentHasSingleTopic_ThenValidateDocumentsSucceeds()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\SingleTopic.doc"), string.Empty, string.Empty);

                VerifyValidationErrors(this.processor.ValidateDocument());
            }
Ejemplo n.º 35
0
 public void WhenDocumentHasNoTitle_ThenValidateDocumentsFails()
 {
     this.processor = new TocGuidanceProcessor(
         PathTo("SampleGuidanceDocs\\NotStartingWithTitle.doc"), string.Empty, string.Empty);
     VerifyValidationErrors(this.processor.ValidateDocument(), 1);
 }
Ejemplo n.º 36
0
            public void WhenDocumentHasMultipleTopicsAndHeadlinesWithDuplicates_ThenValidateDocumentsFails()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\MultipleTopicsAndHeadlinesWithDuplicates.doc"), "FooFeatureId", "Assets/Guidance/Content");

                VerifyValidationErrors(this.processor.ValidateDocument(), 1);
            }
Ejemplo n.º 37
0
            public void WhenDocumentHasOnlyTitle_ThenValidateDocumentsSucceeds()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\JustTitleNoPages.doc"), string.Empty, string.Empty);

                VerifyValidationErrors(this.processor.ValidateDocument());
            }
Ejemplo n.º 38
0
            public void WhenDocumentHasMultipleTopLevelHeadlines_ThenShredDocumentsCreatesDocuments()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\MultipleTopLevelHeadlines.doc"), string.Empty, string.Empty);

                VerifyDocuments(this.processor.GenerateWorkflowDocuments(this.shredDirectory), this.shredDirectory, null);
            }
Ejemplo n.º 39
0
            public void WhenDocumentHasMultipleHeadlinesAndTopics_ThenValidateDocumentsSucceeds()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\MultipleHeadlinesAndTopics.doc"), string.Empty, string.Empty);

                VerifyValidationErrors(this.processor.ValidateDocument());
            }
Ejemplo n.º 40
0
            public void WhenDocumentHasSingleHeadlineNoContent_ThenShredDocumentsCreatesDocuments()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\SingleHeadlineNoContent.doc"), string.Empty, string.Empty);

                VerifyDocuments(this.processor.GenerateWorkflowDocuments(this.shredDirectory), this.shredDirectory, null);
            }
Ejemplo n.º 41
0
            public void WhenDocumentHasTwoTopicsWithHyperlinkToContent_ThenShredDocumentsThrows()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\TwoTopicsWithHyperlinkToContent.doc"), "FooFeatureId", "Assets/Guidance/Content");

                Assert.Throws<InvalidOperationException>(() =>
                    this.processor.GenerateWorkflowDocuments(this.shredDirectory));
            }
Ejemplo n.º 42
0
 public void WhenDocumentHasNoTitle_ThenShredDocumentsThrows()
 {
     this.processor = new TocGuidanceProcessor(
         PathTo("SampleGuidanceDocs\\NotStartingWithTitle.doc"), string.Empty, string.Empty);
     Assert.Throws<InvalidOperationException>(() =>
         this.processor.GenerateWorkflowDocuments(this.shredDirectory));
 }
Ejemplo n.º 43
0
            public void WhenDocumentHasOneHeadlineWithHyperlinkToTopic_ThenValidateDocumentsSucceeds()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\OneHeadlineWithHyperlinkToTopic.doc"), "FooFeatureId", "Assets/Guidance/Content");

                VerifyValidationErrors(this.processor.ValidateDocument());
            }