예제 #1
0
        public void ConfigureTargetWithExtensionTasks()
        {
            ITaskSession session = _sp.GetRequiredService <ITaskSession>();

            SimpleBuildScript bs = new SimpleBuildScript();

            bs.Run(session);

            Assert.True(session.TargetTree.HasAllTargets(new List <string>()
            {
                "extensions"
            }, out _));

            Target t = (Target)session.TargetTree.GetTarget("extensions");

            Assert.Equal(2, t.Tasks.Count);
        }
        public void ConfigureTargetWithIisTasks()
        {
            ITaskSession session = _sp.GetRequiredService <ITaskSession>();

            SimpleBuildScript bs = new SimpleBuildScript();

            bs.Run(session);

            Assert.True(session.TargetTree.HasAllTargets(new List <string>()
            {
                "IIS"
            }, out _));

            Target t = (Target)session.TargetTree.GetTarget("IIS");

            Assert.Equal(2, t.TasksGroups.Count);
            Assert.Empty(t.Dependencies);
        }
예제 #3
0
        public void ConfigureTargetWithExtensionTasksAndDependsOn()
        {
            ITaskSession session = _sp.GetRequiredService <ITaskSession>();

            SimpleBuildScript bs = new SimpleBuildScript();

            bs.Run(session);

            Assert.True(session.TargetTree.HasAllTargets(new List <string>()
            {
                "package"
            }, out _));

            Target t = (Target)session.TargetTree.GetTarget("package");

            Assert.Equal(4, t.Tasks.Count);

            Assert.Equal(2, t.Dependencies.Count);
            Assert.Equal("init", t.Dependencies.First().Key);
            Assert.Equal("restore", t.Dependencies.Last().Key);
        }
        public void ConfigureSimpleTarget()
        {
            ITaskSession session = _sp.GetRequiredService <ITaskSession>();

            SimpleBuildScript bs = new SimpleBuildScript();

            bs.Run(session);

            Assert.True(session.TargetTree.HasAllTargets(new List <string>()
            {
                "test"
            }, out _));
            Assert.True(session.TargetTree.HasAllTargets(new List <string>()
            {
                "test1"
            }, out _));

            ITargetInternal t  = session.TargetTree.GetTarget("test");
            ITargetInternal t1 = session.TargetTree.GetTarget("test1");

            Assert.Equal(t.TargetName, t1.Dependencies.FirstOrDefault().Key);
        }