Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public void Add(Counts peer)
 {
     Rights += peer.Rights;
     Wrongs += peer.Wrongs;
     Exceptions += peer.Exceptions;
     SyntaxErrors += peer.SyntaxErrors;
 }
Esempio n. 3
0
 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;
 }
Esempio n. 4
0
 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;
        }
Esempio n. 6
0
        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);
        }
Esempio n. 7
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);
        }
Esempio n. 8
0
        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);
        }
Esempio n. 9
0
 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);
 }
Esempio n. 10
0
        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);
        }
Esempio n. 12
0
 public void IncrementWrongs()
 {
     Counts.IncrementWrongs();
 }
Esempio n. 13
0
        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);
        }
Esempio n. 14
0
        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();
        }
Esempio n. 17
0
 public bool CanContinue(Counts counts)
 {
     return(true);
 }
Esempio n. 18
0
 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;
        }
Esempio n. 22
0
 public bool CanContinue(Counts counts)
 {
     return true;
 }
Esempio n. 23
0
 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;
        }
Esempio n. 26
0
 public virtual void StartTest(Test test, Counts counts)
 {
     writeDivider();
     write("Starting Test {0} / {1}", test.Name, test.SuiteName);
 }
Esempio n. 27
0
 public void IncrementSyntaxErrors()
 {
     Counts.IncrementSyntaxErrors();
 }
 public bool CanContinue(Counts counts)
 {
     return StepsRun < StepsAllowed;
 }
Esempio n. 29
0
 public TestResult()
 {
     Counts = new Counts();
 }
Esempio n. 30
0
 public void IncrementRights()
 {
     Counts.IncrementRights();
 }
Esempio n. 31
0
        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);
        }
Esempio n. 32
0
 public void IncrementExceptions()
 {
     Counts.IncrementExceptions();
 }
Esempio n. 33
0
 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());
 }
Esempio n. 35
0
        // 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());
        }