[Adapdev-commits] Adapdev/src/Adapdev.UnitTest.Core.Tests Adapdev.UnitTest.Core.Tests.csproj,1.4,1.5
Status: Beta
Brought to you by:
intesar66
From: Sean M. <int...@us...> - 2005-11-16 07:02:03
|
Update of /cvsroot/adapdev/Adapdev/src/Adapdev.UnitTest.Core.Tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv909/src/Adapdev.UnitTest.Core.Tests Added Files: Adapdev.UnitTest.Core.Tests.csproj AdapdevLocalTestEngineTest.cs AssemblyInfo.cs NUnitLocalSeparateTestEngineTest.cs NUnitLocalTestEngineTest.cs TestAssemblyTest.cs TestTest.cs Log Message: --- NEW FILE: TestTest.cs --- using System; namespace Adapdev.UnitTest.Core.Tests { /// <summary> /// Summary description for TestTest. /// </summary> public class TestTest { public TestTest() { // // TODO: Add constructor logic here // } } } --- NEW FILE: AssemblyInfo.cs --- using System.Reflection; using System.Runtime.CompilerServices; // // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. // [assembly: AssemblyTitle("")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("")] [assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.*")] // // In order to sign your assembly you must specify a key to use. Refer to the // Microsoft .NET Framework documentation for more information on assembly signing. // // Use the attributes below to control which key is used for signing. // // Notes: // (*) If no key is specified, the assembly is not signed. // (*) KeyName refers to a key that has been installed in the Crypto Service // Provider (CSP) on your machine. KeyFile refers to a file which contains // a key. // (*) If the KeyFile and the KeyName values are both specified, the // following processing occurs: // (1) If the KeyName can be found in the CSP, that key is used. // (2) If the KeyName does not exist and the KeyFile does exist, the key // in the KeyFile is installed into the CSP and used. // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. // When specifying the KeyFile, the location of the KeyFile should be // relative to the project output directory which is // %Project Directory%\obj\<configuration>. For example, if your KeyFile is // located in the project directory, you would specify the AssemblyKeyFile // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework // documentation for more information on this. // [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: AssemblyKeyName("")] --- NEW FILE: Adapdev.UnitTest.Core.Tests.csproj --- <VisualStudioProject> <CSHARP ProjectType = "Local" ProductVersion = "7.10.3077" SchemaVersion = "2.0" ProjectGuid = "{D0F97D76-E7A6-4059-B902-F792626A29A8}" > <Build> <Settings ApplicationIcon = "" AssemblyKeyContainerName = "" AssemblyName = "Adapdev.UnitTest.Core.Tests" AssemblyOriginatorKeyFile = "" DefaultClientScript = "JScript" DefaultHTMLPageLayout = "Grid" DefaultTargetSchema = "IE50" DelaySign = "false" OutputType = "Library" PreBuildEvent = "" PostBuildEvent = "xcopy ..\..\..\..\lib\nunit $(TargetDir)\nunit /s /e /y /i
copy ..\..\..\Adapdev.UnitTest.Core.AdapdevTests\bin\Debug\Adapdev.UnitTest.Core.AdapdevTests.dll $(TargetDir)\Adapdev.UnitTest.Core.AdapdevTests.dll" RootNamespace = "Adapdev.UnitTest.Core.Tests" RunPostBuildEvent = "OnBuildSuccess" StartupObject = "" > <Config Name = "Debug" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "DEBUG;TRACE" DocumentationFile = "" DebugSymbols = "true" FileAlignment = "4096" IncrementalBuild = "false" NoStdLib = "false" NoWarn = "" Optimize = "false" OutputPath = "bin\Debug\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> <Config Name = "Release" AllowUnsafeBlocks = "false" BaseAddress = "285212672" CheckForOverflowUnderflow = "false" ConfigurationOverrideFile = "" DefineConstants = "TRACE" DocumentationFile = "" DebugSymbols = "false" FileAlignment = "4096" IncrementalBuild = "false" NoStdLib = "false" NoWarn = "" Optimize = "true" OutputPath = "bin\Release\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" WarningLevel = "4" /> </Settings> <References> <Reference Name = "System" AssemblyName = "System" HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.dll" /> <Reference Name = "System.Data" AssemblyName = "System.Data" HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.Data.dll" /> <Reference Name = "System.XML" AssemblyName = "System.Xml" HintPath = "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" /> <Reference Name = "Adapdev.UnitTest.Core" Project = "{B8592DE8-C10B-4ACB-A422-919C02C04B05}" Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> <Reference Name = "Adapdev" Project = "{CC30A321-2569-4B1F-8E1A-781B5509B56D}" Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> <Reference Name = "nunit.framework" AssemblyName = "nunit.framework" HintPath = "..\..\lib\nunit.framework.dll" /> </References> </Build> <Files> <Include> <File RelPath = "AdapdevLocalTestEngineTest.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "AssemblyInfo.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "NUnitLocalSeparateTestEngineTest.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "NUnitLocalTestEngineTest.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "TestAssemblyTest.cs" SubType = "Code" BuildAction = "Compile" /> <File RelPath = "TestTest.cs" SubType = "Code" BuildAction = "Compile" /> </Include> </Files> </CSHARP> </VisualStudioProject> --- NEW FILE: NUnitLocalTestEngineTest.cs --- using System; using Adapdev; using Adapdev.UnitTest; using Adapdev.UnitTest.Core; using NUnit.Framework; namespace Adapdev.UnitTest.Core.Tests { /// <summary> /// Summary description for LocalSeparateTestEngineTest. /// </summary> /// [TestFixture] public class NUnitLocalTestEngineTest { private static readonly string basedir = @AppDomain.CurrentDomain.BaseDirectory; [Test] public void LoadNUnit2_2_2() { Console.WriteLine(AppDomain.CurrentDomain.BaseDirectory); ITestEngine engine = TestEngineFactory.CreateLocal(basedir + @"\nunit\222\nunit.framework.tests.dll"); Assert.IsTrue(engine.GetLoadedAssemblies().Count > 0, "No assemblies loaded."); TestAssembly assembly = engine.GetTestAssembly(); Assert.IsTrue(assembly.GetTestCount() > 0, "No tests loaded."); } [Test] public void RunNUnit2_2_2() { ITestEngine engine = TestEngineFactory.CreateLocal(basedir + @"\nunit\222\nunit.framework.tests.dll"); Assert.IsTrue(engine.GetLoadedAssemblies().Count > 0, "No assemblies loaded."); TestAssembly assembly = engine.GetTestAssembly(); Assert.IsTrue(assembly.GetTestCount() > 0, "No tests loaded."); TestAssemblyResult result = engine.Run(engine.GetTestAssembly()); Assert.AreEqual(300, result.Passed); } } } --- NEW FILE: TestAssemblyTest.cs --- using System; using NUnit.Framework; using Adapdev.UnitTest.Core; namespace Adapdev.UnitTest.Core.Tests { /// <summary> /// Summary description for Class1. /// </summary> /// [TestFixture] public class TestAssemblyTest { [Test] public void GetCount() { // Create the assembly TestAssembly ta = new TestAssembly(); // Create the first TestFixture and // add two tests TestFixture tf1 = new TestFixture(); Test t1 = new Test(); Test t2 = new Test(); t2.RepeatCount = 5; Assert.AreEqual(1, t1.GetTestCount()); Assert.AreEqual(5, t2.GetTestCount()); tf1.AddTest(t1); tf1.AddTest(t2); Assert.AreEqual(6, tf1.GetTestCount()); // Create the second TestFixture and // add two tests TestFixture tf2 = new TestFixture(); Test t3 = new Test(); Test t4 = new Test(); t4.RepeatCount = 5; Assert.AreEqual(1, t3.GetTestCount()); Assert.AreEqual(5, t4.GetTestCount()); tf2.AddTest(t3); tf2.AddTest(t4); Assert.AreEqual(6, tf2.GetTestCount()); ta.AddTestFixture(tf1); ta.AddTestFixture(tf2); // Make sure the total number of tests is correct // Should be 1 + 5 + 1 + 5 = 12 Assert.AreEqual(12, ta.GetTestCount()); // Ignore the second test t2.Ignore = true; Assert.AreEqual(7, ta.GetTestCount()); // Unignore the second test t2.Ignore = false; // Ignore the first test fixture tf1.Ignore = true; Assert.AreEqual(6, ta.GetTestCount()); // Ignore the second test fixture tf2.Ignore = true; Assert.AreEqual(0, ta.GetTestCount()); } } } --- NEW FILE: AdapdevLocalTestEngineTest.cs --- using System; using NUnit.Framework; namespace Adapdev.UnitTest.Core.Tests { /// <summary> /// Summary description for AdapdevLocalTestEngineTest. /// </summary> /// [TestFixture] public class AdapdevLocalTestEngineTest { private static readonly string basedir = @AppDomain.CurrentDomain.BaseDirectory; [Test] public void LoadAdapdev() { using(ITestEngine engine = TestEngineFactory.CreateLocal(basedir + @"\Adapdev.UnitTest.Core.AdapdevTests.dll")) { Assert.IsTrue(engine.GetLoadedAssemblies().Count > 0, "No assemblies loaded."); TestAssembly assembly = engine.GetTestAssembly(); Assert.IsTrue(assembly.GetTestCount() > 0, "No tests loaded."); } } [Test] public void RunAdapdev() { using(ITestEngine engine = TestEngineFactory.CreateLocal(basedir + @"\Adapdev.UnitTest.Core.AdapdevTests.dll")) { Assert.IsTrue(engine.GetLoadedAssemblies().Count > 0, "No assemblies loaded."); TestAssembly assembly = engine.GetTestAssembly(); Assert.IsTrue(assembly.GetTestCount() > 0, "No tests loaded."); TestAssemblyResult result = engine.Run(engine.GetTestAssembly()); Console.WriteLine(new Adapdev.UnitTest.Core.TextFormatter(new TestAssemblyResult[]{result}, true, true, true).GetText()); Assert.AreEqual(20, result.Passed); Assert.AreEqual(2, result.Failed); } } } } --- NEW FILE: NUnitLocalSeparateTestEngineTest.cs --- using System; using Adapdev; using Adapdev.UnitTest; using Adapdev.UnitTest.Core; using NUnit.Framework; namespace Adapdev.UnitTest.Core.Tests { /// <summary> /// Summary description for LocalSeparateTestEngineTest. /// </summary> /// [TestFixture] public class NUnitLocalSeparateTestEngineTest { private static readonly string basedir = @AppDomain.CurrentDomain.BaseDirectory; [Test] public void LoadNUnit2_2_2() { using(ITestEngine engine = TestEngineFactory.CreateLocalSeparate(basedir, basedir + @"\nunit\222\nunit.framework.tests.dll.config", basedir + @"\nunit\222\nunit.framework.tests.dll")) { Assert.IsTrue(engine.GetLoadedAssemblies().Count > 0, "No assemblies loaded."); TestAssembly assembly = engine.GetTestAssembly(); Assert.IsTrue(assembly.GetTestCount() > 0, "No tests loaded."); } } public void LoadNUnit2_2_2WithoutConfigParam() { using(ITestEngine engine = TestEngineFactory.CreateLocalSeparate(basedir, basedir + @"\nunit\222\nunit.framework.tests.dll")) { Assert.AreEqual(basedir + @"\nunit\222\nunit.framework.tests.dll.config", engine.ConfigurationFile, "Configuration file was not automatically detected."); Assert.IsTrue(engine.GetLoadedAssemblies().Count > 0, "No assemblies loaded."); TestAssembly assembly = engine.GetTestAssembly(); Assert.IsTrue(assembly.GetTestCount() > 0, "No tests loaded."); } } [Test] public void RunNUnit2_2_2() { using(ITestEngine engine = TestEngineFactory.CreateLocalSeparate(basedir, basedir + @"\nunit\222\nunit.framework.tests.dll.config", basedir + @"\nunit\222\nunit.framework.tests.dll")) { Assert.IsTrue(engine.GetLoadedAssemblies().Count > 0, "No assemblies loaded."); TestAssembly assembly = engine.GetTestAssembly(); Assert.IsTrue(assembly.GetTestCount() > 0, "No tests loaded."); TestAssemblyResult result = engine.Run(engine.GetTestAssembly()); Assert.AreEqual(302, result.Passed); } } [Test] public void LoadNUnit2_2_0() { using(ITestEngine engine = TestEngineFactory.CreateLocalSeparate(basedir, basedir + @"\nunit\220\nunit.tests.dll.config", basedir + @"\nunit\220\nunit.tests.dll")) { Assert.IsTrue(engine.GetLoadedAssemblies().Count > 0, "No assemblies loaded."); TestAssembly assembly = engine.GetTestAssembly(); Assert.IsTrue(assembly.GetTestCount() > 0, "No tests loaded."); } } public void LoadNUnit2_2_0WithoutConfigParam() { using(ITestEngine engine = TestEngineFactory.CreateLocalSeparate(basedir, basedir + @"\nunit\220\nunit.tests.dll")) { Assert.AreEqual(basedir + @"\nunit\220\nunit.tests.dll.config", engine.ConfigurationFile, "Configuration file was not automatically detected."); Assert.IsTrue(engine.GetLoadedAssemblies().Count > 0, "No assemblies loaded."); TestAssembly assembly = engine.GetTestAssembly(); Assert.IsTrue(assembly.GetTestCount() > 0, "No tests loaded."); } } [Test] public void RunNUnit2_2_0() { using(ITestEngine engine = TestEngineFactory.CreateLocalSeparate(basedir, basedir + @"\nunit\220\nunit.tests.dll.config", basedir + @"\nunit\220\nunit.tests.dll")) { Assert.IsTrue(engine.GetLoadedAssemblies().Count > 0, "No assemblies loaded."); TestAssembly assembly = engine.GetTestAssembly(); Assert.IsTrue(assembly.GetTestCount() > 0, "No tests loaded."); TestAssemblyResult result = engine.Run(engine.GetTestAssembly()); Assert.AreEqual(368, result.Passed); } } } } |