// The following code was generated by Microsoft Visual Studio 2005.
// The test owner should check each test for validity.
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;
using System.Collections.Generic;
using Virtuoso.Miranda.Plugins.Infrastructure;
namespace Virtuoso.Miranda.Plugins.UnitTests
{
///
///This is a test class for Virtuoso.Miranda.Plugins.Native.CLISTMENUITEM and is intended
///to contain all Virtuoso.Miranda.Plugins.Native.CLISTMENUITEM Unit Tests
///
[TestClass(),
MenuItemDeclaration("l", null, Tag = "A", HasIcon = true, UseEmbeddedIcon = true),
MenuItemDeclaration("l", null, Tag = "B", HasIcon = true, UseEmbeddedIcon = true, IconID = "NotHere.ico"),
MenuItemDeclaration("l", null, Tag = "C", HasIcon = true, UseEmbeddedIcon = true, IconID = "Virtuoso.Miranda.Plugins.UnitTests.Here.ico")]
public class CLISTMENUITEMTest
{
private TestContext testContextInstance;
///
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region Additional test attributes
//
//You can use the following additional attributes as you write your tests:
//
//Use ClassInitialize to run code before running the first test in the class
//
//[ClassInitialize()]
//public static void MyClassInitialize(TestContext testContext)
//{
//}
//
//Use ClassCleanup to run code after all tests in a class have run
//
//[ClassCleanup()]
//public static void MyClassCleanup()
//{
//}
//
//Use TestInitialize to run code before running each test
//
//[TestInitialize()]
//public void MyTestInitialize()
//{
//}
//
//Use TestCleanup to run code after each test has run
//
//[TestCleanup()]
//public void MyTestCleanup()
//{
//}
//
#endregion
///
///A test for CLISTMENUITEM (MenuItemDeclarationAttribute)
///
[TestMethod(), ExpectedException(typeof(ArgumentNullException))]
public void ConstructorTest()
{
new MenuItemDeclarationAttribute(null, null);
}
///
///A test for CLISTMENUITEM (MenuItemDeclarationAttribute)
///
[TestMethod()]
public void ConstructorTest2()
{
MenuItemDeclarationAttribute[] attribs = (MenuItemDeclarationAttribute[])this.GetType().GetCustomAttributes(typeof(MenuItemDeclarationAttribute), false);
foreach (MenuItemDeclarationAttribute attrib in attribs)
{
ValueType native = Virtuoso_Miranda_Plugins_Native_CLISTMENUITEMAccessor.CreatePrivate(new FooPlugin(), attrib);
switch (attrib.Tag)
{
case "A":
case "B":
Assert.AreEqual(IntPtr.Zero, native.GetType().GetField("Icon").GetValue(native));
break;
case "C":
Assert.AreNotEqual(IntPtr.Zero, native.GetType().GetField("Icon").GetValue(native));
break;
}
}
}
}
}