public void ShouldPlotChartForAvailableStatistics() { mockPlotter.Expect("DrawGraph", new IsAnything(), new IsAnything(), new IsAnything()); mockPlotter.ExpectNoCall("WriteToStream", typeof(IList), typeof(IList), typeof(Stream)); chartGenerator.RelevantStats = new string[]{"TestCount"}; chartGenerator.Process(statistics, "dummy"); }
public void ShouldNotInvokeDecoratedTriggerWhenTimeAndWeekDayMatch() { mockTrigger.ExpectNoCall("Fire"); mockDateTime.ExpectAndReturn("Now", new DateTime(2004, 12, 1, 10, 30, 0, 0)); Assert.IsNull(trigger.Fire(), "trigger.Fire()"); }
public void ShouldNotLabelSourceControlifLabelOnSuccessisTrueAndResultisFailed() { alienbrain.LabelOnSuccess = true; executor.ExpectNoCall("Execute", typeof(ProcessInfo)); alienbrain.LabelSourceControl(IntegrationResultMother.CreateFailed()); executor.Verify(); }
public void ShouldCheckModificationsAndReturnIfDelayIsZero() { quietPeriod.ModificationDelaySeconds = 0; mockSourceControl.ExpectAndReturn("GetModifications", mods, lastBuild, thisBuild); mockDateTimeProvider.ExpectNoCall("Sleep", typeof(TimeSpan)); Modification[] actualMods = quietPeriod.GetModifications((ISourceControl)mockSourceControl.MockInstance, lastBuild, thisBuild); Assert.AreEqual(mods, actualMods); }
public void GetModificationsWhenApplyLabelIsDisabledDoesNotCreateLabels() { ProcessResult result = new ProcessResult("", string.Empty, 0, false); Modification[] dummyArray = new Modification[1] { new Modification() }; _historyParser.SetupResult("Parse", dummyArray, typeof(TextReader), typeof(DateTime), typeof(DateTime)); _executor.ExpectAndReturn("Execute", result, new IsTypeOf(typeof(ProcessInfo))); _executor.ExpectNoCall("Execute", typeof(ProcessInfo)); _vss.GetModifications(IntegrationResultMother.CreateSuccessful(DateTime.Now), IntegrationResultMother.CreateSuccessful(DateTime.Now)); }
public void InvalidProjectFileName() { ExpectThatExecuteWillNotBeCalled(); _mockRegistry.ExpectNoCall("GetLocalMachineSubKeyValue", new Type[] { typeof(string), typeof(string) }); NetReflector.Read(@"<FinalBuilder> <ProjectFile>C:\Dummy\Project.txt</ProjectFile> </FinalBuilder>" , _task); Assert.That(delegate { _task.Run(_result); }, Throws.TypeOf <BuilderException>().With.Message.EqualTo("Finalbuilder version could not be autodetected from project file name.")); }
protected void ExpectThatExecuteWillNotBeCalled() { mockProcessExecutor.ExpectNoCall("Execute", typeof(ProcessInfo)); }