public void basic_weekpicker_render()
 {
     var html = new WeekPicker("foo").ToString();
     html.ShouldHaveHtmlNode("foo")
         .ShouldBeNamed(HtmlTag.Input)
         .ShouldHaveAttribute(HtmlAttribute.Type).WithValue(HtmlInputType.Week);
 }
예제 #2
0
        public void weekpicker_correctly_formats_date_value()
        {
            var value   = new DateTime(2011, 1, 3);
            var element = new WeekPicker("test").Value(value);

            element.ValueAttributeShouldEqual("2011-W02");
        }
예제 #3
0
        public void basic_weekpicker_render()
        {
            var html = new WeekPicker("foo").ToString();

            html.ShouldHaveHtmlNode("foo")
            .ShouldBeNamed(HtmlTag.Input)
            .ShouldHaveAttribute(HtmlAttribute.Type).WithValue(HtmlInputType.Week);
        }
예제 #4
0
        public void weekpicker_correctly_formats_date_value_using_custom_rules()
        {
            var value   = new DateTime(2011, 1, 2);
            var element = new WeekPicker("test")
                          .Evaluation(CalendarWeekRule.FirstFullWeek, DayOfWeek.Sunday)
                          .Value(value);

            element.ValueAttributeShouldEqual("2011-W01");
        }
예제 #5
0
        public void weekpicker_limit_sets_limits_without_step()
        {
            var element = new WeekPicker("x")
                          .Evaluation(CalendarWeekRule.FirstFullWeek, DayOfWeek.Sunday)
                          .Limit(new DateTime(2000, 1, 2), new DateTime(2000, 01, 9)).ToString()
                          .ShouldHaveHtmlNode("x");

            element.ShouldHaveAttribute(HtmlAttribute.Min).WithValue("2000-W01");
            element.ShouldHaveAttribute(HtmlAttribute.Max).WithValue("2000-W02");
            element.ShouldNotHaveAttribute(HtmlAttribute.Step);
        }
 public void weekpicker_limit_sets_limits_without_step()
 {
     var element = new WeekPicker("x")
         .Evaluation(CalendarWeekRule.FirstFullWeek, DayOfWeek.Sunday)
         .Limit(new DateTime(2000, 1, 2), new DateTime(2000, 01, 9)).ToString()
         .ShouldHaveHtmlNode("x");
     element.ShouldHaveAttribute(HtmlAttribute.Min).WithValue("2000-W01");
     element.ShouldHaveAttribute(HtmlAttribute.Max).WithValue("2000-W02");
     element.ShouldNotHaveAttribute(HtmlAttribute.Step);
 }
 public void weekpicker_correctly_formats_date_value_using_custom_rules()
 {
     var value = new DateTime(2011, 1, 2);
     var element = new WeekPicker("test")
         .Evaluation(CalendarWeekRule.FirstFullWeek, DayOfWeek.Sunday)
         .Value(value);
     element.ValueAttributeShouldEqual("2011-W01");
 }
 public void weekpicker_correctly_formats_date_value()
 {
     var value = new DateTime(2011, 1, 3);
     var element = new WeekPicker("test").Value(value);
     element.ValueAttributeShouldEqual("2011-W02");
 }