Sure. Here it is:
[TestClass]
public class SS_Identity_Types_Edit_Tests : TestsVS
{
SS_Identity_Types_FullEdit_Form view = null;
\[TestInitialize\] public override void RunBeforeAllTests()
{
base.RunBeforeAllTests();
view = new SS\_Identity\_Types\_FullEdit\_Form(this.basicWindow.DS);
PrepareEditForm(view, GetNamedContextOrCreate("SS\_Identity\_Types", false), false);
view.IsRunLoadActions = false;
view.Visible = true;
view.Visible = false;
}
\[TestMethod\] public void TestPrerequisites()
{
Assert.IsNotNull(view);
}
\[TestCleanup\] public override void RunAfterAllTests()
{
view.Close();
view = null;
base.RunAfterAllTests ();
}
}
it inherits from sthm like this:
\[TestInitialize()\]
public virtual void RunBeforeAllTests()
{
basicWindow = DoCreateMainWindow();
DoActionsOnLoad();
basicWindow.LoadDataFromDataBase();
}
\[ClassCleanup\]
public static void ClassCleanup()
{
// Here is commented bacause it really doesn't help
//try
//{
// System.GC.Collect();
//}
//catch
//{
//}
}
\[TestCleanup()\]
public virtual void RunAfterAllTests()
{
InvokePrivateMethod(basicWindow, new object\[\] { new EventArgs() }, "OnClosed");
this.basicWindow.Close();
this.basicWindow = null;
}
I'm pretty sure there are leaks, but I can't get how to find them. As i've said JetBrains attached to test process doesn't show my classes, so, obviousely, I do sthm wrong in my profiling.