Beispiel #1
0
        public void PBS_AfterSelect_Calls_DoDefaultAction()
        {
            var des = mr.StrictMock <TreeNodeDesigner>();

            des.Expect(d => d.DoDefaultAction());
            des.Stub(d => d.Initialize(null)).IgnoreArguments();
            mockTree = new FakeTreeView();
            mr.ReplayAll();

            var pbs = new ProjectBrowserService(sc, mockTree);

            pbs.AddComponents(new object[] { des });
            var desdes = pbs.GetDesigner(des);

            Assert.IsNotNull(desdes);

            mockTree.SelectedNode = des.TreeNode;

            mr.VerifyAll();
        }
        public void PBS_AfterSelect_Calls_DoDefaultAction()
        {
            var des = new Mock <TreeNodeDesigner> {
                CallBase = true
            };

            des.Setup(d => d.DoDefaultAction()).Verifiable();
            des.Setup(d => d.Initialize(It.IsAny <object>()));
            des.Object.Component = "foo";
            var mockTree = new FakeTreeView();

            var pbs = new ProjectBrowserService(sc, tabPage.Object, mockTree);

            pbs.AddComponents(new object[] { des.Object });
            var desdes = pbs.GetDesigner(des.Object);

            Assert.IsNotNull(desdes);

            mockTree.SelectedNode = des.Object.TreeNode;

            des.Verify();
        }