예제 #1
0
        public void RefreshImageWithNullableOptionPageTest()
        {
            OptionsCompositeControl target = compositeControl;
            Microsoft_Samples_VisualStudio_IDE_OptionsPage_OptionsCompositeControlAccessor accessor = compositeControlAccessor;

            accessor.customOptionsPage = null;
            accessor.RefreshImage();
        }
예제 #2
0
        public void OptionsPageTest()
        {
            OptionsCompositeControl target        = compositeControl;
            OptionsPageCustom       expectedValue = new OptionsPageCustom();

            target.OptionsPage = expectedValue;
            Assert.AreEqual(expectedValue, target.OptionsPage,
                            "OptionsPage property was initialized by unexpected value.");
        }
예제 #3
0
        public void WindowTest()
        {
            OptionsPageCustom target = optionsPageCustom;
            Microsoft_Samples_VisualStudio_IDE_OptionsPage_OptionsPageCustomAccessor accessor = new Microsoft_Samples_VisualStudio_IDE_OptionsPage_OptionsPageCustomAccessor(target);
            OptionsCompositeControl optionsControl = new OptionsCompositeControl();

            optionsControl = accessor.Window as OptionsCompositeControl;
            Assert.IsNotNull(optionsControl, "Internal Window property was not initialized by expected value.");
            Assert.AreEqual(optionsControl.OptionsPage, target, "Internal CompositeCOntrol options page property was initialized by unexpected value.");
        }
예제 #4
0
        public void DisposeTest()
        {
            OptionsCompositeControl target = compositeControl;

            Assert.IsTrue((target is IDisposable),
                          "Tested OptionsCompositeControl instance does not implements IDisposable interface.");

            target.Dispose();
            Assert.IsTrue(target.IsDisposed,
                          "Internal state of the OptionsCompositeControl instance is in the NotDosposed state, was expected that IsDisosed is True.");
        }
예제 #5
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.");
        }
예제 #6
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.");
        }
예제 #7
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);
     }
 }
예제 #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();
            }
        }
예제 #9
0
 public void TestCleanup()
 {
     compositeControl         = null;
     compositeControlAccessor = null;
 }
예제 #10
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.");
 }
예제 #11
0
        public void ConstructorTest()
        {
            OptionsCompositeControl target = new OptionsCompositeControl();

            Assert.IsNotNull(target, "Instance of the OptionsCompositeControl was not created successfully after default constructor call.");
        }