Example #1
0
 /// <summary>
 /// Clean up any resources being used.
 /// </summary>
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (compositeControl != null)
         {
             compositeControl.Dispose();
             compositeControl = null;
         }
         if (compositeControlAccessor != null)
         {
             compositeControlAccessor.Dispose(true);
             compositeControlAccessor = null;
         }
         GC.SuppressFinalize(this);
     }
 }
 /// <summary> 
 /// Clean up any resources being used.
 /// </summary>
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (compositeControl != null)
         {
             compositeControl.Dispose();
             compositeControl = null;
         }
         if (compositeControlAccessor != null)
         {
             compositeControlAccessor.Dispose(true);
             compositeControlAccessor = null;
         }
         GC.SuppressFinalize(this);
     }
 }
 public void TestInitialize()
 {
     compositeControl = new OptionsCompositeControl();
     compositeControlAccessor = new Microsoft_Samples_VisualStudio_IDE_OptionsPage_OptionsCompositeControlAccessor(compositeControl);
     Assert.IsNotNull(compositeControl, "General OptionsCompositeControl instance (compositeControl) was not created successfully.");
 }
 public void TestCleanup()
 {
     compositeControl = null;
     compositeControlAccessor = null;
 }
        public void InitializeComponentTest()
        {
            OptionsCompositeControl target = new OptionsCompositeControl();
            Assert.IsNotNull(target, "Instance of the OptionsCompositeControl object was not created successfully.");
            Microsoft_Samples_VisualStudio_IDE_OptionsPage_OptionsCompositeControlAccessor accessor = new Microsoft_Samples_VisualStudio_IDE_OptionsPage_OptionsCompositeControlAccessor(target);
            Assert.IsNotNull(accessor, "Instance of the OptionsCompositeControl accessor was not created successfully.");

            accessor.InitializeComponent();

            Assert.IsNotNull(target.Controls, "Controls collection was not initialized after InitializeComponent() call.");
            Assert.IsTrue((target.Controls.Count>0), "Controls collection was not populated by controls objects.");
        }
Example #6
0
 public void TestCleanup()
 {
     compositeControl         = null;
     compositeControlAccessor = null;
 }
Example #7
0
 public void TestInitialize()
 {
     compositeControl         = new OptionsCompositeControl();
     compositeControlAccessor = new Microsoft_Samples_VisualStudio_IDE_OptionsPage_OptionsCompositeControlAccessor(compositeControl);
     Assert.IsNotNull(compositeControl, "General OptionsCompositeControl instance (compositeControl) was not created successfully.");
 }
Example #8
0
        public void RefreshImageWithCompleteOptionPageTest()
        {
            OptionsCompositeControl target = compositeControl;
            Microsoft_Samples_VisualStudio_IDE_OptionsPage_OptionsCompositeControlAccessor accessor = compositeControlAccessor;

            try
            {
                CreateTestBitmapFile();

                accessor.customOptionsPage = new OptionsPageCustom();
                accessor.pictureBox.Image  = null;
                accessor.customOptionsPage.CustomBitmap = testCustomImagePath;
                accessor.RefreshImage();

                Assert.IsNotNull(accessor.pictureBox.Image,
                                 "Internal PictureBox Image object was not initialized.");
            }finally
            {
                DestroyTestBitmapFile();
            }
        }
Example #9
0
        public void RefreshImageWithNullableOptionPageTest()
        {
            OptionsCompositeControl target = compositeControl;
            Microsoft_Samples_VisualStudio_IDE_OptionsPage_OptionsCompositeControlAccessor accessor = compositeControlAccessor;

            accessor.customOptionsPage = null;
            accessor.RefreshImage();
        }
Example #10
0
        public void OnClearImageTest()
        {
            OptionsCompositeControl target = compositeControl;
            Microsoft_Samples_VisualStudio_IDE_OptionsPage_OptionsCompositeControlAccessor accessor = compositeControlAccessor;

            accessor.customOptionsPage = new OptionsPageCustom();

            accessor.customOptionsPage.CustomBitmap = testCustomImagePath;
            Assert.AreEqual(testCustomImagePath, accessor.customOptionsPage.CustomBitmap,
                            "CustomBitmap path was not initialized by expected value.");

            accessor.OnClearImage(this, EventArgs.Empty);

            Assert.IsNull(accessor.customOptionsPage.CustomBitmap,
                          "CustomBitmap path after Clear command was not cleared.");
        }
Example #11
0
        public void InitializeComponentTest()
        {
            OptionsCompositeControl target = new OptionsCompositeControl();

            Assert.IsNotNull(target, "Instance of the OptionsCompositeControl object was not created successfully.");
            Microsoft_Samples_VisualStudio_IDE_OptionsPage_OptionsCompositeControlAccessor accessor = new Microsoft_Samples_VisualStudio_IDE_OptionsPage_OptionsCompositeControlAccessor(target);

            Assert.IsNotNull(accessor, "Instance of the OptionsCompositeControl accessor was not created successfully.");

            accessor.InitializeComponent();

            Assert.IsNotNull(target.Controls, "Controls collection was not initialized after InitializeComponent() call.");
            Assert.IsTrue((target.Controls.Count > 0), "Controls collection was not populated by controls objects.");
        }