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);
            }
 public void WhenDocumentHasNoTitle_ThenCalculateWorkflowThrows()
 {
     this.processor = new TocGuidanceProcessor(
         PathTo("SampleGuidanceDocs\\NotStartingWithTitle.doc"), string.Empty, string.Empty);
     Assert.Throws <InvalidOperationException>(() =>
                                               this.processor.CalculateWorkflow());
 }
            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());
 }
            public void WhenDocumentHasOnlyTitle_ThenValidateDocumentsSucceeds()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\JustTitleNoPages.doc"), string.Empty, string.Empty);

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

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

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

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

                VerifyValidationErrors(this.processor.ValidateDocument());
            }
Пример #10
0
            public void WhenDocumentHasTwoTopicsWithHyperlinkToContent_ThenValidateDocumentsFails()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\TwoTopicsWithHyperlinkToContent.doc"), "FooFeatureId", "Assets/Guidance/Content");

                VerifyValidationErrors(this.processor.ValidateDocument(), 1);
            }
Пример #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);
            }
Пример #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));
 }
Пример #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));
            }
Пример #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;
        }
Пример #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",
                });
            }
Пример #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",
                });
            }
            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),
                    });
            }
Пример #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",
                });
            }
Пример #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),
                });
            }
Пример #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),
                });
            }
            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),
                    });
            }
Пример #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"
                });
            }
 public void WhenDocumentEmpty_ThenValidateDocumentsFails()
 {
     this.processor = new TocGuidanceProcessor(
         PathTo("SampleGuidanceDocs\\EmptyDocument.doc"), string.Empty, string.Empty);
     VerifyValidationErrors(this.processor.ValidateDocument(), 1);
 }
            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",
                });
            }
            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" 
                });
            }
Пример #27
0
 public void WhenDocumentEmpty_ThenValidateDocumentsFails()
 {
     this.processor = new TocGuidanceProcessor(
         PathTo("SampleGuidanceDocs\\EmptyDocument.doc"), string.Empty, string.Empty);
     VerifyValidationErrors(this.processor.ValidateDocument(), 1);
 }
Пример #28
0
 public void WhenDocumentHasNoTitle_ThenValidateDocumentsFails()
 {
     this.processor = new TocGuidanceProcessor(
         PathTo("SampleGuidanceDocs\\NotStartingWithTitle.doc"), string.Empty, string.Empty);
     VerifyValidationErrors(this.processor.ValidateDocument(), 1);
 }
            public void WhenDocumentHasTwoTopicsWithHyperlinkToContent_ThenValidateDocumentsFails()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\TwoTopicsWithHyperlinkToContent.doc"), "FooFeatureId", "Assets/Guidance/Content");

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

                Assert.Throws<InvalidOperationException>(() =>
                    this.processor.GenerateWorkflowDocuments(this.shredDirectory));
            }
            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",
                });
            }
            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);
            }
            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",
                });
            }
            public void WhenDocumentHasSingleTopic_ThenValidateDocumentsSucceeds()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\SingleTopic.doc"), string.Empty, string.Empty);

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

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

                VerifyValidationErrors(this.processor.ValidateDocument());
            }
            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 WhenDocumentHasMultipleHeadlinesAndTopics_ThenValidateDocumentsSucceeds()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\MultipleHeadlinesAndTopics.doc"), string.Empty, string.Empty);

                VerifyValidationErrors(this.processor.ValidateDocument());
            }
            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);
            }
            public void WhenDocumentHasTwoTopicsWithHyperlinkToContent_ThenShredDocumentsThrows()
            {
                this.processor = new TocGuidanceProcessor(
                    PathTo("SampleGuidanceDocs\\TwoTopicsWithHyperlinkToContent.doc"), "FooFeatureId", "Assets/Guidance/Content");

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

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