protected override void Before_each_spec() { PropertyDictionary propertyDictionary = Mocks.Stub<PropertyDictionary>((Project) null); _task = Mocks.DynamicMock<Task>(); SetupResult.For(_task.Properties).Return(propertyDictionary); Mocks.Replay(_task); _sut = new NAntRunListener(_task); }
protected override void Before_each_spec() { _specificationInfo = new SpecificationInfo("Spec", "Type"); PropertyDictionary propertyDictionary = Mocks.Stub<PropertyDictionary>((Project) null); _task = Mocks.StrictMock<Task>(); SetupResult.For(_task.Properties).Return(propertyDictionary); Mocks.Replay(_task); _sut = new NAntRunListener(_task); }
protected override void Before_each_spec() { _contextInfo = new ContextInfo("Context", "Concern", "TypeName", "Namespace", "AssemblyName"); PropertyDictionary propertyDictionary = Mocks.Stub<PropertyDictionary>((Project) null); _task = Mocks.DynamicMock<Task>(); SetupResult.For(_task.Properties).Return(propertyDictionary); Mocks.Replay(_task); _sut = new NAntRunListener(_task); }
/// <summary> /// Executes the task. /// </summary> protected override void ExecuteTask() { DisplayTaskConfiguration(); if (FileSetHelper.Count(Assemblies) == 0) { Log(Level.Warning, "No specification assemblies, aborting task"); return; } List<ISpecificationRunListener> listeners = SetUpListeners(); NAntRunListener nantRunListener = new NAntRunListener(this); listeners.Add(nantRunListener); AggregateRunListener rootListener = new AggregateRunListener(listeners); ISpecificationRunner runner = new AppDomainRunner(rootListener, RunOptions.Default); RunSpecifications(Assemblies, runner); Log(Level.Info, "Finished running specs"); if (nantRunListener.FailureOccurred) { throw new BuildException("There were failing specifications. Please see the build log."); } }