当前位置: 首页>>代码示例>>C#>>正文


C# Project.Touch方法代码示例

本文整理汇总了C#中Project.Touch方法的典型用法代码示例。如果您正苦于以下问题:C# Project.Touch方法的具体用法?C# Project.Touch怎么用?C# Project.Touch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Project的用法示例。


在下文中一共展示了Project.Touch方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestTouchProjectItem_CallsNotifiyItemChanged

        public void TestTouchProjectItem_CallsNotifiyItemChanged()
        {
            var underTest = new Project();
            var itemKind = "test";
            var item = new ProjectItem("p1", itemKind);
            underTest.AddItem(item);

            var processor = new Mock<IProjectObserver>();
            processor.Setup(s => s.NotifyItemChanged(underTest, item));

            underTest.AddObserver(processor.Object);

            underTest.Touch(item);

            processor.VerifyAll();
        }
开发者ID:TerrificNet,项目名称:TerrificNet,代码行数:16,代码来源:ProjectTest.cs

示例2: Test_BuilderAddedLinks_CalledOnChange

        //[Fact]
        public void Test_BuilderAddedLinks_CalledOnChange()
        {
            var kind = "test";
            var project = new Project();
            var observerMock = new Mock<IProjectObserver>();
            project.AddObserver(observerMock.Object);

            var p1 = AddAndCreateItem(kind, project, "p1");
            var p2 = AddAndCreateItem("related", project, "p2");

            var id1 = new ProjectItemIdentifier("created", "created");

            var task = new Mock<IBuildTask>();
            task.SetupGet(p => p.DependsOn).Returns(BuildQuery.SingleFromKind(kind).Or(BuildQuery.Exact(p2.Identifier)));

            var s1 = new BuildTaskResult(id1, NullProjectItemContent.Instance);

            SetupProceed(task, p1).Returns(new[] { s1 });

            var builder = new Builder(project);
            builder.AddTask(task.Object);

            project.Touch(p2);

            observerMock.Verify(s => s.NotifyItemChanged(project, It.Is<ProjectItem>(i => i.Identifier.Kind == kind)), Times.Once());
        }
开发者ID:TerrificNet,项目名称:TerrificNet,代码行数:27,代码来源:BuilderTest.cs

示例3: TestChangePropagation

        public void TestChangePropagation()
        {
            var kind = "test";
            var projectItem = new ProjectItem("p1", kind);

            var project = new Project();
            var observerMock = new Mock<IProjectObserver>();
            project.AddObserver(observerMock.Object);

            var underTest = new Builder(project);

            var kind2 = "created";
            var kind3 = "created2";

            var buildTarget = CreateBuildTarget(kind, kind2);
            var buildTarget2 = CreateBuildTarget(kind2, kind3);

            underTest.AddTask(buildTarget);
            underTest.AddTask(buildTarget2);

            project.AddItem(projectItem);

            project.Touch(projectItem);

            observerMock.Verify(s => s.NotifyItemChanged(project, It.Is<ProjectItem>(i => i.Identifier.Kind == kind)), Times.Once());
            observerMock.Verify(s => s.NotifyItemChanged(project, It.Is<ProjectItem>(i => i.Identifier.Kind == kind2)), Times.Once());
            observerMock.Verify(s => s.NotifyItemChanged(project, It.Is<ProjectItem>(i => i.Identifier.Kind == kind3)), Times.Once());
        }
开发者ID:TerrificNet,项目名称:TerrificNet,代码行数:28,代码来源:BuilderTest.cs


注:本文中的Project.Touch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。