Exemplo n.º 1
0
        public void RefreshImageWithNullableOptionPageTest()
        {
            OptionsCompositeControl target = compositeControl;
            Microsoft_Samples_VisualStudio_IDE_OptionsPage_OptionsCompositeControlAccessor accessor = compositeControlAccessor;

            accessor.customOptionsPage = null;
            accessor.RefreshImage();
        }
Exemplo n.º 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.");
        }
Exemplo n.º 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.");
        }
Exemplo n.º 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.");
        }
Exemplo n.º 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.");
        }
Exemplo n.º 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.");
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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();
            }
        }
Exemplo n.º 9
0
 public void TestCleanup()
 {
     compositeControl         = null;
     compositeControlAccessor = null;
 }
Exemplo n.º 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.");
 }
Exemplo n.º 11
0
        public void ConstructorTest()
        {
            OptionsCompositeControl target = new OptionsCompositeControl();

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