#develop (short for SharpDevelop) is a free IDE for .NET programming languages.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

79 lines
1.7 KiB

// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
// <version>$Revision$</version>
// </file>
using System;
using ICSharpCode.SharpDevelop.Dom;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.UnitTesting;
using NUnit.Framework;
using UnitTesting.Tests.Utils;
namespace UnitTesting.Tests.Project
{
/// <summary>
/// Tests that a class with an inner test fixture is recognised, for example:
///
/// public class A
/// {
/// [TestFixture]
/// public class InnerATest
/// {
/// [Test]
/// public void FooBar()
/// {
/// }
/// }
/// }
///
/// In this case the FooBar test is identified via: "A+InnerATest.FooBar".
/// </summary>
[TestFixture]
public class InnerClassTestFixture : InnerClassTestFixtureBase
{
[SetUp]
public void Init()
{
base.InitBase();
}
[Test]
public void OneTestClassFound()
{
Assert.AreEqual(1, testProject.TestClasses.Count);
}
[Test]
public void TestClassQualifiedName()
{
Assert.AreEqual("MyTests.A+InnerATest", testClass.QualifiedName);
}
[Test]
public void TestClassName()
{
Assert.AreEqual("A+InnerATest", testClass.Name);
}
[Test]
public void NoTestClassesForNamespaceMyTestsA()
{
Assert.AreEqual(0, testProject.GetTestClasses("MyTests.A").Length);
}
[Test]
public void OneTestClassForNamespaceMyTests()
{
Assert.AreEqual(1, testProject.GetTestClasses("MyTests").Length);
}
[Test]
public void NamespaceForInnerClassIsDeclaringTypesNamespace()
{
Assert.AreEqual("MyTests", testClass.Namespace);
}
}
}