Пример #1
0
        public void StSlnPMapTest4()
        {
            var target = new BuildComponentProjectsStub();

            Assert.Equal(EXIST_GUID, target.Eval("[Build solution.current.GuidList]"));
            Assert.Equal(EXIST_GUID, target.Eval("[Build solution.path(\"stub.sln\").GuidList]"));
        }
Пример #2
0
        public void ProjectsMapTest3()
        {
            var target = new BuildComponentProjectsStub(new NullBuildEnv()
            {
                IsOpenedSolution = true,
                SolutionFile     = "path\\to.sln",
            });

            target.SMap.SetPrj(EXIST_GUID, "Project1", "path\\to.sln", target.SMap.Project1Type);

            bool h(string l1, string l2)
            {
                Assert.Equal("Project1", target.Eval(string.Format("[Build solution.{0}.{1}.name.RightProperty]", l1, l2)));
                Assert.Equal("path\\to.sln", target.Eval(string.Format("[Build solution.{0}.{1}.path.RightProperty]", l1, l2)));
                Assert.Equal(EXIST_GUID, target.Eval(string.Format("[Build solution.{0}.{1}.guid.RightProperty]", l1, l2)));
                Assert.Equal(target.SMap.Project1Type, target.Eval(string.Format("[Build solution.{0}.{1}.type.RightProperty]", l1, l2)));
                return(true);
            }

            Assert.Throws <NotSupportedOperationException>(() => h("current", "First"));
            Assert.Throws <NotSupportedOperationException>(() => h("current", "Last"));
            Assert.Throws <NotSupportedOperationException>(() => h("current", "FirstRaw"));
            Assert.Throws <NotSupportedOperationException>(() => h("current", "LastRaw"));
            Assert.Throws <NotSupportedOperationException>(() => h("current", "projectBy(\"" + EXIST_GUID + "\")"));
            Assert.Throws <NotSupportedOperationException>(() => h("path(\"path\\to.sln\")", "First"));
            Assert.Throws <NotSupportedOperationException>(() => h("path(\"path\\to.sln\")", "Last"));
            Assert.Throws <NotSupportedOperationException>(() => h("path(\"path\\to.sln\")", "FirstRaw"));
            Assert.Throws <NotSupportedOperationException>(() => h("path(\"path\\to.sln\")", "LastRaw"));
            Assert.Throws <NotSupportedOperationException>(() => h("path(\"path\\to.sln\")", "projectBy(\"" + EXIST_GUID + "\")"));
        }
Пример #3
0
        public void StTypeTest2()
        {
            var target = new BuildComponentProjectsStub();

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[Build type = true]")
                                                   );
        }
Пример #4
0
        public void StSlnPMapTest5()
        {
            var target = new BuildComponentProjectsStub();

            Assert.Throws <ArgumentException>(() =>
                                              Assert.Equal(Value.Empty, target.Eval("[Build solution.current.projectBy()]"))
                                              );
        }
Пример #5
0
        public void StSolutionTest3()
        {
            var target = new BuildComponentProjectsStub();

            Assert.Throws <IncorrectNodeException>(() =>
                                                   Assert.Equal(Value.Empty, target.Eval("[Build solution.NotRealProperty]"))
                                                   );
        }
Пример #6
0
        public void StSlnPMapTest3()
        {
            var target = new BuildComponentProjectsStub();

            Assert.Throws <KeyNotFoundException>(() =>
                                                 Assert.Equal(Value.Empty, target.Eval("[Build solution.current.projectBy(\"" + NOTEXIST_GUID + "\")]"))
                                                 );
        }
Пример #7
0
        public void StProjectConfTest2()
        {
            var target = new BuildComponentProjectsStub();

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[Build projects.find(\"project1\").NotExist = true]")
                                                   );
        }
Пример #8
0
        public void StProjectConfTest1()
        {
            var target = new BuildComponentProjectsStub();

            Assert.Throws <IncorrectSyntaxException>(() =>
                                                     target.Eval("[Build projects.find(\"project1\").IsBuildable = val]")
                                                     );
        }
Пример #9
0
        public void StProjectsTest2()
        {
            var target = new BuildComponentProjectsStub();

            Assert.Throws <IncorrectSyntaxException>(() =>
                                                     target.Eval("[Build projects.find(\"NotExist\").]")
                                                     );
        }
Пример #10
0
        public void StSolutionTest1()
        {
            var target = new BuildComponentProjectsStub();

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[Build solution.current]")
                                                   );

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[Build solution.path(\"path.sln\")]")
                                                   );
        }
Пример #11
0
        public void ProjectsMapTest2()
        {
            var target = new BuildComponentProjectsStub(new NullBuildEnv()
            {
                IsOpenedSolution = true,
                SolutionFile     = "stub.sln",
            });

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[Build solution.path(\"stub.sln\").First.NotRealProperty]")
                                                   );

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[Build solution.current.First.NotRealProperty]")
                                                   );
        }
Пример #12
0
        public void StSlnPMapTest2()
        {
            var target = new BuildComponentProjectsStub();

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[Build solution.path(\"stub.sln\").First]")
                                                   );

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[Build solution.path(\"stub.sln\").Last]")
                                                   );

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[Build solution.path(\"stub.sln\").LastRaw]")
                                                   );

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[Build solution.path(\"stub.sln\").projectBy(\"" + EXIST_GUID + "\")]")
                                                   );
        }
Пример #13
0
        public void StSlnPMapTest1()
        {
            var target = new BuildComponentProjectsStub();

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[Build solution.current.NotExistProperty]")
                                                   );

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[Build solution.current.First]")
                                                   );

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[Build solution.current.Last]")
                                                   );

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[Build solution.current.LastRaw]")
                                                   );

            Assert.Throws <IncorrectNodeException>(() =>
                                                   target.Eval("[Build solution.current.projectBy(\"" + EXIST_GUID + "\")]")
                                                   );
        }
Пример #14
0
        public void IsDeployableTest1()
        {
            var target = new BuildComponentProjectsStub();

            Assert.Equal(Value.Empty, target.Eval("[Build projects.find(\"project1\").IsDeployable = true]"));
        }