Пример #1
0
        public void DoesNotOutputExistingFilesWithDifferentExtension()
        {
            // Given
            Engine.InitialMetadata[Keys.RelativeFilePath] = new FilePath("test.txt");
            IDocument[] inputs = new[] { Context.GetDocument() };
            UnwrittenFiles unwrittenFiles = new UnwrittenFiles(".md");

            // When
            IEnumerable<IDocument> outputs = unwrittenFiles.Execute(inputs, Context).ToList();

            // Then
            Assert.AreEqual(0, outputs.Count());
        }
Пример #2
0
        public void ShouldOutputNonExistingFiles()
        {
            // Given
            Engine.InitialMetadata[Keys.RelativeFilePath] = new FilePath("foo.txt");
            IDocument[] inputs = new[] { Context.GetDocument("Test") };
            UnwrittenFiles unwrittenFiles = new UnwrittenFiles();

            // When
            IEnumerable<IDocument> outputs = unwrittenFiles.Execute(inputs, Context).ToList();

            // Then
            Assert.AreEqual(1, outputs.Count());
            Assert.AreEqual("Test", outputs.First().Content);
        }