Esempio n. 1
0
        public ProjectTreeWriter(IProjectTree tree, ProjectTreeWriterOptions options)
        {
            Requires.NotNull(tree, nameof(tree));

            _parent  = tree;
            _options = options;
        }
        private void AssertProjectTree(string input, string expected, ProjectTreeWriterOptions options = ProjectTreeWriterOptions.Capabilities | ProjectTreeWriterOptions.FilePath | ProjectTreeWriterOptions.Visibility)
        {
            // Remove the newlines from the start and end of input and expected so that
            // it makes it easier inside the test to layout the repro.
            input    = input.Trim(new[] { '\n', '\r' });
            expected = expected.Trim(new[] { '\n', '\r' });

            var parser = new ProjectTreeParser(input);
            var writer = new ProjectTreeWriter(parser.Parse(), options | ProjectTreeWriterOptions.Tags);

            string result = writer.WriteToString();

            Assert.Equal(expected, result, ignoreLineEndingDifferences: true);
        }