示例#1
0
        public void InvalidNotUnique()
        {
            var none       = new IContained[] { };
            var empty      = new List <FileLine>();
            var sourceList = new List <ISourceFile>
            {
                new SourceFile(string.Empty, "project/src/File1", none, string.Empty, empty),
                new SourceFile(string.Empty, "project/src/File1", none, string.Empty, empty)
            };

            var project = new Project(sourceList);

            ITraverserAction action = TraverserActions.UniqueSourceNames as ITraverserAction <Project>;

            action.Act(project, new StandardErrorListener <TraverserException>());
        }
示例#2
0
        public void ValidNotUnique()
        {
            var none       = new IContained[] { };
            var empty      = new List <FileLine>();
            var sourceList = new List <ISourceFile>
            {
                new SourceFile(string.Empty, "project/src/File1", none, string.Empty, empty),
                new SourceFile(string.Empty, "project/examples/File1", none, string.Empty, empty)
            };

            var project = new Project(sourceList);

            ITraverserAction action = TraverserActions.UniqueSourceNames as ITraverserAction <Project>;

            action.Act(project, new StandardErrorListener <TraverserException>());
            Assert.AreEqual(1, project.SourceNameUniquenessLevel);
            Assert.AreEqual("src/File1", sourceList[0].Name);
            Assert.AreEqual("examples/File1", sourceList[1].Name);
        }