Ejemplo n.º 1
0
        public void Toggling_options_should_initiate_redirect()
        {
            _navigator.Initialize("http://localhost/");
            var options = new ViewOptions(_navigator);

            options.ToggleClosed();
            _navigator.LastUri.ShouldBe("http://localhost:80/?showclosed=y");
            options.ToggleUnplanned();
            _navigator.LastUri.ShouldBe("http://localhost:80/?showclosed=y&showunplanned=y");
            options.ToggleClosed();
            _navigator.LastUri.ShouldBe("http://localhost:80/?showunplanned=y");
            options.ToggleUnplanned();
            _navigator.LastUri.ShouldBe("http://localhost:80/");
            options.ToggleTodayIndicator();
            _navigator.LastUri.ShouldBe("http://localhost:80/?hidetodayindicator=y");
            options.ToggleCardDetails();
            _navigator.LastUri.ShouldBe("http://localhost:80/?hidetodayindicator=y&hidecarddetails=y");
            options.ToggleCardDetails();
            options.ToggleTodayIndicator();
            _navigator.LastUri.ShouldBe("http://localhost:80/");
            options.ToggleSelectedProjects("P1");
            options.ToggleSelectedProjects("P2");
            _navigator.LastUri.ShouldBe("http://localhost:80/?selectedprojects=p1;p2");
            options.ToggleSelectedProjects("p1");
            options.ToggleSelectedProjects("p2");
            _navigator.LastUri.ShouldBe("http://localhost:80/");
        }
Ejemplo n.º 2
0
        public void Toggle_should_trigger_options_changed()
        {
            _navigator.Initialize("http://localhost/");
            var options = new ViewOptions(_navigator);
            var counter = 0;

            options.OptionsChanged += () => counter++;

            options.ToggleUnplanned();
            counter.ShouldBe(1);
            options.ToggleClosed();
            counter.ShouldBe(2);
            options.ToggleTodayIndicator();
            counter.ShouldBe(3);
            options.ToggleCardDetails();
            counter.ShouldBe(4);
            options.ToggleSelectedProjects("px");
            counter.ShouldBe(5);
        }