SetBreakpoint() public méthode

public SetBreakpoint ( Breakpoint breakpoint ) : void
breakpoint Breakpoint
Résultat void
        public void set_breakpoint()
        {
            var breakpoint1 = new Breakpoint("1", null);
            var breakpoint2 = new Breakpoint("2", null);

            var specification = new Specification();

            specification.SetBreakpoint(breakpoint1);
            specification.SetBreakpoint(breakpoint2);

            specification.SetBreakpoint(breakpoint1);
            specification.SetBreakpoint(breakpoint2);

            specification.Breakpoints.ShouldHaveTheSameElementsAs(breakpoint1, breakpoint2);
        }
        public void matches_breakpoint()
        {
            var breakpoint1 = new Breakpoint("1", null);
            var breakpoint2 = new Breakpoint("2", 0);

            var specification = new Specification();

            specification.SetBreakpoint(breakpoint1);
            specification.SetBreakpoint(breakpoint2);

            specification.MatchesBreakpoint("3", null).ShouldBeFalse();
            specification.MatchesBreakpoint("2", 1).ShouldBeFalse();
            specification.MatchesBreakpoint("2", 0).ShouldBeTrue();
            specification.MatchesBreakpoint("1", null).ShouldBeTrue();
        }
        public void remove_breakpoint()
        {
            var breakpoint1 = new Breakpoint("1", null);
            var breakpoint2 = new Breakpoint("2", null);

            var specification = new Specification();

            specification.SetBreakpoint(breakpoint1);
            specification.SetBreakpoint(breakpoint2);

            specification.RemoveBreakpoint(breakpoint1);

            specification.Breakpoints.Single()
                .ShouldBe(breakpoint2);
        }
        public void matches_breakpoint_with_stages()
        {
            var breakpoint1 = new Breakpoint("1", Stage.after);
            var breakpoint2 = new Breakpoint("2", Stage.before);

            var specification = new Specification();

            specification.SetBreakpoint(breakpoint1);
            specification.SetBreakpoint(breakpoint2);

            specification.MatchesBreakpoint("1", "after").ShouldBeTrue();
            specification.MatchesBreakpoint("1", "before").ShouldBeFalse();
            specification.MatchesBreakpoint("2", "before").ShouldBeTrue();
            specification.MatchesBreakpoint("2", "after").ShouldBeFalse();
        }