1
#region Copyright (c) 2003, James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, Charlie Poole, Philip A. Craig
2
/************************************************************************************
4
' Copyright 2002-2003 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, Charlie Poole
5
' Copyright 2000-2002 Philip A. Craig
7
' This software is provided 'as-is', without any express or implied warranty. In no
8
' event will the authors be held liable for any damages arising from the use of this
11
' Permission is granted to anyone to use this software for any purpose, including
12
' commercial applications, and to alter it and redistribute it freely, subject to the
13
' following restrictions:
15
' 1. The origin of this software must not be misrepresented; you must not claim that
16
' you wrote the original software. If you use this software in a product, an
17
' acknowledgment (see the following) in the product documentation is required.
19
' Portions Copyright 2002-2003 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov, Charlie Poole
20
' or Copyright 2000-2002 Philip A. Craig
22
' 2. Altered source versions must be plainly marked as such, and must not be
23
' misrepresented as being the original software.
25
' 3. This notice may not be removed or altered from any source distribution.
27
'***********************************************************************************/
31
using System.Collections;
32
using NUnit.Framework;
35
using NUnit.Tests.Assemblies;
37
namespace NUnit.Core.Tests
40
public class SuiteBuilderTests_Multiple
42
private static readonly int totalTests = NoNamespaceTestFixture.Tests + MockAssembly.Tests;
44
private TestSuiteBuilder builder;
45
private static string[] assemblies = new string[]
46
{ "nonamespace-assembly.dll", "mock-assembly.dll" };
47
private TestSuite loadedSuite;
50
public void LoadSuite()
52
builder = new TestSuiteBuilder();
53
loadedSuite = builder.Build( "TestSuite", assemblies );
57
public void BuildSuite()
59
Assert.IsNotNull( loadedSuite );
63
public void RootNode()
65
Assert.IsTrue( loadedSuite is RootTestSuite );
66
Assert.AreEqual( "TestSuite", loadedSuite.Name );
70
public void AssemblyNodes()
72
Assert.IsTrue( loadedSuite.Tests[0] is TestAssembly );
73
Assert.IsTrue( loadedSuite.Tests[1] is TestAssembly );
77
public void TestCaseCount()
79
Assert.AreEqual( totalTests , loadedSuite.CountTestCases());
83
public void LoadFixture()
85
TestSuite suite = builder.Build(
86
"MultipleAssemblies", assemblies,
87
"NUnit.Tests.Assemblies.MockTestFixture" );
88
Assert.IsNotNull( suite );
89
Assert.AreEqual( MockTestFixture.Tests, suite.CountTestCases() );