public void NamespaceSetUpFixtureReplacesNamespaceNodeInTree() { string nameSpace = "NUnit.TestData.SetupFixture.Namespace1"; IDictionary <string, object> options = new Dictionary <string, object>(); options["LOAD"] = new string[] { nameSpace }; ITest suite = builder.Build(testAssembly, options); Assert.IsNotNull(suite); Assert.AreEqual(testAssembly, suite.FullName); Assert.AreEqual(1, suite.Tests.Count, "Error in top level test count"); string[] nameSpaceBits = nameSpace.Split('.'); for (int i = 0; i < nameSpaceBits.Length; i++) { suite = suite.Tests[0] as TestSuite; Assert.AreEqual(nameSpaceBits[i], suite.Name); Assert.AreEqual(1, suite.Tests.Count); Assert.That(suite.RunState, Is.EqualTo(RunState.Runnable)); } Assert.That(suite, Is.InstanceOf <SetUpFixture>()); suite = suite.Tests[0] as TestSuite; Assert.AreEqual("SomeFixture", suite.Name); Assert.AreEqual(1, suite.Tests.Count); Assert.That(suite.RunState, Is.EqualTo(RunState.Runnable)); Assert.That(suite.Tests[0].RunState, Is.EqualTo(RunState.Runnable)); }
/// <summary> /// Loads the tests found in an Assembly /// </summary> /// <param name="assemblyName">File name of the assembly to load</param> /// <param name="settings">Dictionary of option settings for loading the assembly</param> /// <returns>True if the load was successful</returns> public ITest Load(string assemblyName, IDictionary settings) { Settings = settings; Randomizer.InitialSeed = GetInitialSeed(settings); return(LoadedTest = _builder.Build(assemblyName, settings)); }
public bool Load(string assemblyName, IDictionary settings) { this.settings = settings; loadedTest = builder.Build(assemblyName, settings); if (loadedTest == null) { return(false); } return(true); }
/// <summary> /// Loads the tests found in an Assembly /// </summary> /// <param name="assemblyName">File name of the assembly to load</param> /// <param name="settings">Dictionary of option settings for loading the assembly</param> /// <returns>True if the load was successful</returns> public ITest Load(string assemblyName, IDictionary <string, object> settings) { Settings = settings; if (settings.ContainsKey(FrameworkPackageSettings.RandomSeed)) { Randomizer.InitialSeed = (int)settings[FrameworkPackageSettings.RandomSeed]; } return(LoadedTest = _builder.Build(assemblyName, settings)); }
/// <summary> /// Loads the tests found in an Assembly /// </summary> /// <param name="assemblyName">File name of the assembly to load</param> /// <param name="settings">Dictionary of option settings for loading the assembly</param> /// <returns>True if the load was successful</returns> public bool Load(string assemblyName, IDictionary settings) { _settings = settings; Randomizer.InitialSeed = settings.Contains("RandomSeed") ? (int)settings["RandomSeed"] : new Random().Next(); _loadedTest = (TestSuite)_builder.Build(assemblyName, settings); if (_loadedTest == null) { return(false); } return(true); }
public void Add(Assembly assembly) { testSuite = builder.Build(assembly, loadOptions); if (testSuite == null) { throw new Exception("Could not load " + assembly); } // if (!runner.Load (assembly, loadOptions)) // throw new Exception ("Could not load " + assembly); }
public TestSuite Build(Assembly assembly, IDictionary options) { return(GroupByNamespace(innerAssemblyBuilder.Build(assembly, options))); }