Esempio n. 1
0
        public void ContextMenuStrip_Always_CallsContextMenuBuilderMethods()
        {
            // Setup
            var mocks = new MockRepository();

            using (var treeViewControl = new TreeViewControl())
            {
                var menuBuilder = mocks.StrictMock <IContextMenuBuilder>();
                using (mocks.Ordered())
                {
                    menuBuilder.Expect(mb => mb.AddPropertiesItem()).Return(menuBuilder);
                    menuBuilder.Expect(mb => mb.Build()).Return(null);
                }

                var output = new EmptyStabilityStoneCoverOutput();

                var gui = mocks.Stub <IGui>();
                gui.Stub(cmp => cmp.Get(output, treeViewControl)).Return(menuBuilder);
                mocks.ReplayAll();

                using (var plugin = new StabilityStoneCoverPlugin())
                {
                    TreeNodeInfo info = GetInfo(plugin);
                    plugin.Gui = gui;

                    // Call
                    info.ContextMenuStrip(output, null, treeViewControl);
                }
            }

            // Assert
            mocks.VerifyAll();
        }
Esempio n. 2
0
        public void Image_Always_ReturnOutputIcon()
        {
            // Setup
            var output = new EmptyStabilityStoneCoverOutput();

            using (var plugin = new StabilityStoneCoverPlugin())
            {
                TreeNodeInfo info = GetInfo(plugin);
                // Call
                Image icon = info.Image(output);

                // Assert
                TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.GeneralOutputIcon, icon);
            }
        }
Esempio n. 3
0
        public void ForeColor_Always_ReturnGrayText()
        {
            // Setup
            var output = new EmptyStabilityStoneCoverOutput();

            using (var plugin = new StabilityStoneCoverPlugin())
            {
                TreeNodeInfo info = GetInfo(plugin);

                // Call
                Color color = info.ForeColor(output);

                // Assert
                Assert.AreEqual(Color.FromKnownColor(KnownColor.GrayText), color);
            }
        }
Esempio n. 4
0
        public void Text_Always_ReturnName()
        {
            // Setup
            var output = new EmptyStabilityStoneCoverOutput();

            using (var plugin = new StabilityStoneCoverPlugin())
            {
                TreeNodeInfo info = GetInfo(plugin);

                // Call
                string nodeText = info.Text(output);

                // Assert
                Assert.AreEqual("Resultaat", nodeText);
            }
        }