public void Locked_Twice()
        {
            ToolboxItem item = new ToolboxItem();

            item.Lock();
            item.Lock();
        }
        public void NullValues()
        {
            ToolboxItem item = new ToolboxItem();

            item.AssemblyName = null;
            Assert.IsNull(item.AssemblyName, "AssemblyName");
            item.Bitmap = null;
            Assert.IsNull(item.Bitmap, "Bitmap");
            item.DisplayName = null;
            Assert.AreEqual(String.Empty, item.DisplayName, "DisplayName");
            item.Filter = null;
            Assert.AreEqual(0, item.Filter.Count, "Filter");
            item.TypeName = null;
            Assert.AreEqual(String.Empty, item.TypeName, "TypeName");
            item.Company = null;
            Assert.AreEqual(String.Empty, item.Company, "Company");
            // can't assign null without a NRE
            item.DependentAssemblies = new AssemblyName [0];
            Assert.AreEqual(0, item.DependentAssemblies.Length, "DependentAssemblies");
            item.Description = null;
            Assert.AreEqual(String.Empty, item.Description, "Description");
            item.IsTransient = true;
            Assert.IsTrue(item.IsTransient, "IsTransient");
            Assert.AreEqual(9, item.Properties.Count, "Properties");
            item.Lock();
            Assert.AreEqual(9, item.Properties.Count, "Properties/Lock");
        }
示例#3
0
        public void Initialize_Locked_Null()
        {
            ToolboxItem item = new ToolboxItem();

            item.Lock();
            item.Initialize(null);
        }
示例#4
0
        public void ToolBoxItem_Lock()
        {
            var         type      = typeof(Bitmap);
            ToolboxItem underTest = new ToolboxItem(type);

            underTest.Lock();
            Assert.True(underTest.Locked);
        }
 public void Initialize_Locked_Null()
 {
     Assert.Throws <InvalidOperationException>(() =>
     {
         ToolboxItem item = new ToolboxItem();
         item.Lock();
         item.Initialize(null);
     });
 }