Example #1
0
        public void AddItemsToMenuTest()
        {
            FileMenuProviderTest _newInstance = FileMenuProviderTest.CreteInstance();

            using (ContextMenuStrip _strip = new ContextMenuStrip())
            {
                _newInstance.AddItemsToMenu(_strip);
                Assert.AreEqual <int>(4, _strip.Items.Count);
                _strip.Items.Clear();
                _newInstance.AddItemsToMenu(_strip);
                Assert.AreEqual <int>(4, _strip.Items.Count);
            }
        }
Example #2
0
        public void AddItemsToMenuContentTest()
        {
            FileMenuProviderTest _newInstance = FileMenuProviderTest.CreteInstance();

            using (ContextMenuStrip _strip = new ContextMenuStrip())
            {
                _newInstance.AddItemsToMenu(_strip);
                Assert.AreEqual <int>(4, _strip.Items.Count);
                Assert.AreEqual <string>("&New", _strip.Items[0].Text);
                Assert.AreEqual <string>("&Open...", _strip.Items[1].Text);
                Assert.AreEqual <string>("&Save", _strip.Items[2].Text);
                //Assert.IsTrue(_strip.Items[2].Enabled); //It depends on license installation. After removing license must be true always
                Assert.AreEqual <string>("Save &As...", _strip.Items[3].Text);
                //Assert.IsTrue(_strip.Items[3].Enabled);//It depends on license installation. After removing license must be true always
            }
        }
        public void AddItemsToMenuContentTest()
        {
            FileMenuProviderTest _newInstance = FileMenuProviderTest.CreteInstance();

            using (ContextMenuStrip _strip = new ContextMenuStrip())
            {
                _newInstance.AddItemsToMenu(_strip);
                Assert.AreEqual <int>(4, _strip.Items.Count);
                Assert.AreEqual <string>("&New", _strip.Items[0].Text);
                Assert.AreEqual <string>("&Open...", _strip.Items[1].Text);
                Assert.AreEqual <string>("&Save", _strip.Items[2].Text);
                Assert.IsTrue(_strip.Items[2].Enabled);
                Assert.AreEqual <string>("Save &As...", _strip.Items[3].Text);
                Assert.IsTrue(_strip.Items[3].Enabled);
            }
        }