public void RefreshImageWithNullableOptionPageTest() { OptionsCompositeControl target = compositeControl; Microsoft_Samples_VisualStudio_IDE_OptionsPage_OptionsCompositeControlAccessor accessor = compositeControlAccessor; accessor.customOptionsPage = null; accessor.RefreshImage(); }
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."); }
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."); }
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."); }
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."); }
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."); }
/// <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 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(); } }
public void TestCleanup() { compositeControl = null; compositeControlAccessor = null; }
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 ConstructorTest() { OptionsCompositeControl target = new OptionsCompositeControl(); Assert.IsNotNull(target, "Instance of the OptionsCompositeControl was not created successfully after default constructor call."); }