public void add_two_counts() { var count1 = new Counts { Rights = 2, Wrongs = 3, Exceptions = 4, SyntaxErrors = 7 }; var count2 = new Counts { Rights = 7, Wrongs = 4, Exceptions = 10, SyntaxErrors = 14 }; count1.Add(count2); count1.Rights.ShouldEqual(9); count1.Wrongs.ShouldEqual(7); count1.Exceptions.ShouldEqual(14); count1.SyntaxErrors.ShouldEqual(21); count2.Rights.ShouldEqual(7); count2.Wrongs.ShouldEqual(4); count2.Exceptions.ShouldEqual(10); count2.SyntaxErrors.ShouldEqual(14); }
public void Add(Counts peer) { Rights += peer.Rights; Wrongs += peer.Wrongs; Exceptions += peer.Exceptions; SyntaxErrors += peer.SyntaxErrors; }
public bool Equals(Counts obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; return obj.Rights == Rights && obj.Wrongs == Wrongs && obj.Exceptions == Exceptions && obj.SyntaxErrors == SyntaxErrors; }
public void Add(Counts peer) { Rights += peer.Rights; Wrongs += peer.Wrongs; Exceptions += peer.Exceptions; SyntaxErrors += peer.SyntaxErrors; }
public bool CanContinue(Counts counts) { if (_request.BreakOnExceptions && counts.Exceptions > 0) return false; if (_request.BreakOnWrongs && counts.Wrongs > 0) return false; return true; }
public void counts_are_all_zero_on_construction() { var counts = new Counts(); counts.Wrongs.ShouldEqual(0); counts.Rights.ShouldEqual(0); counts.Exceptions.ShouldEqual(0); counts.SyntaxErrors.ShouldEqual(0); }
public void increment_wrongs() { var counts = new Counts(); counts.IncrementWrongs(); counts.Wrongs.ShouldEqual(1); counts.IncrementWrongs(); counts.Wrongs.ShouldEqual(2); counts.IncrementWrongs(); counts.Wrongs.ShouldEqual(3); }
public void increment_rights() { var counts = new Counts(); counts.IncrementRights(); counts.Rights.ShouldEqual(1); counts.IncrementRights(); counts.Rights.ShouldEqual(2); counts.IncrementRights(); counts.Rights.ShouldEqual(3); }
public bool Equals(Counts obj) { if (ReferenceEquals(null, obj)) { return(false); } if (ReferenceEquals(this, obj)) { return(true); } return(obj.Rights == Rights && obj.Wrongs == Wrongs && obj.Exceptions == Exceptions && obj.SyntaxErrors == SyntaxErrors); }
public void WriteResults(Counts counts) { var countsTag = new HtmlTag("div").AddClass("results"); if (counts.WasSuccessful()) { countsTag.Text("Succeeded with " + counts.ToString()); countsTag.AddClass("results-" + HtmlClasses.PASS); } else { countsTag.Text("Failed with " + counts.ToString()); countsTag.AddClass("results-" + HtmlClasses.FAIL); } _suiteName.Next = countsTag; }
public void SetUp() { grammar = Fixture.VerifyStringList(() => { throw new NotImplementedException(); }).Titled( "The list of strings should be").LeafNameIs("row").Grammar(); step = new Step("anything").WithChildren("row", new Step(), new Step(), new Step()); var context = new TestContext(); grammar.Execute(step, context); counts = context.Counts; rowResults = context.ResultsFor(step).GetResult<IList<SetRow>>(grammar.LeafName); stepResults = context.ResultsFor(step); }
public void IncrementWrongs() { Counts.IncrementWrongs(); }
public void SetUp() { step = new Step("a").With("key1", "123"); cell = new Cell("key1", typeof (int)); counts = new Counts(); cell.ReadArgument(new TestContext(), step, x => argument = (int) x); }
public void SetUp() { step = new Step("a").With("key1", "abc"); cell = new Cell("key1", typeof (int)); var context = new TestContext(); cell.ReadArgument(context, step, x => Assert.Fail("should not have called me")); counts = context.Counts; results = context.ResultsFor(step); }
public void SetUp() { grammars = new IGrammar[] { MockRepository.GenerateMock<IGrammar>(), MockRepository.GenerateMock<IGrammar>(), MockRepository.GenerateMock<IGrammar>() }; ClassUnderTest = new ParagraphGrammar(grammars); step = MockRepository.GenerateMock<IStep>(); context = MockRepository.GenerateMock<AutoPerformingTestContext>(); counts = new Counts(); }
public void SetUp() { test = new Test("some test", x => { section = x.Section("Math").WithStep("Add").WithStep("Subtract").WithStep("Minus"); }); counts = new Counts(); progression = new TestProgression(test, counts); progression.Start(section); progression.Start(section.Parts[0]); counts.IncrementRights(); progression.IncrementProgress(section.Parts[0]); counts.IncrementWrongs(); status = progression.BuildStatus(); }
public bool CanContinue(Counts counts) { return(true); }
public void StartTest(Test test, Counts counts) { }
public void StartTest(Test test, Counts counts) { StepsRun = 0; }
public void SetUp() { _step = null; theFixture = null; theCounts = null; StepValues = null; GrammarKey = null; }
private void then() { var context = new TestContext(); context.CurrentObject = TheAddress; grammar.Execute(step, context); TheCounts = context.Counts; }
public bool CanContinue(Counts counts) { return true; }
public TestResult() { Counts = new Counts(); }
void ITestObserver.StartTest(Test test, Counts counts) { lock (_locker) { _progression = new TestProgression(test, counts); } Publish(); }
public void SetUp() { target = new BeforeAndAfterTarget(); grammar = new TableLineGrammar(target); step = new Step().With("FirstName:Jeremy,LastName:Miller,Age:23,State:TX"); StepExecutionResult execute = grammar.Execute(step); results = execute.Results; counts = execute.Counts; }
public virtual void StartTest(Test test, Counts counts) { writeDivider(); write("Starting Test {0} / {1}", test.Name, test.SuiteName); }
public void IncrementSyntaxErrors() { Counts.IncrementSyntaxErrors(); }
public bool CanContinue(Counts counts) { return StepsRun < StepsAllowed; }
public TestResult() { Counts = new Counts(); }
public void IncrementRights() { Counts.IncrementRights(); }
public void reset_clears_all_counts_to_zero() { var count1 = new Counts { Rights = 2, Wrongs = 3, Exceptions = 4, SyntaxErrors = 7 }; count1.Reset(); count1.ShouldEqual(0, 0, 0, 0); }
public void IncrementExceptions() { Counts.IncrementExceptions(); }
public virtual void StartTest(Test test, Counts counts) { writeDivider(); write("Starting Test {0} / {1}", test.Name, test.SuiteName); }
// Makes use of TeamCity's support for Service Messages // http://www.jetbrains.net/confluence/display/TCD4/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ReportingTests public override void StartTest(Test test, Counts counts) { Console.WriteLine("##teamcity[testStarted name='{0}']", test.Name.Escape()); }
// Makes use of TeamCity's support for Service Messages // http://www.jetbrains.net/confluence/display/TCD4/Build+Script+Interaction+with+TeamCity#BuildScriptInteractionwithTeamCity-ReportingTests public override void StartTest(Test test, Counts counts) { Console.WriteLine("##teamcity[testStarted name='{0}']", test.Name.Escape()); }