public void GetPropertyParser_DateAlignmentIsSent_EnumPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.DateAlignment)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <EnumPropertyParser>(); }
public void GetPropertyParser_SlotLabelIntervalIsSent_TimeSpanPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.SlotLabelInterval)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <TimeSpanPropertyParser>(); }
public void GetPropertyParser_DefaultDateIsSent_DateTimePropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.DefaultDate)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <DateTimePropertyParser>(); }
public void GetPropertyParser_HandleWindowResizeIsSent_DoublePropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.HandleWindowResize)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <BoolPropertyParser>(); }
public void GetPropertyParser_ViewsIsSent_CustomViewPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.Views)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <CustomViewPropertyParser>(); }
public void GetPropertyParser_ContentHeightIsSent_UnitPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.ContentHeight)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <UnitPropertyParser>(); }
public void GetPropertyParser_AspectRatioIsSent_DoublePropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.AspectRatio)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <DoublePropertyParser>(); }
public void GetPropertyParser_BusinessHoursIsSent_BusinessHoursPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.BusinessHours)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <BusinessHoursPropertyParser>(); }
public void GetPropertyParser_WeekNumbersWithinDaysIsSent_BoolPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.WeekNumbersWithinDays)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <BoolPropertyParser>(); }
public void GetPropertyParser_HiddenDaysIsSent_ArrayPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.HiddenDays)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <ArrayPropertyParser>(); }
public void GetPropertyParser_ThemeSystemIsSent_ThemeSystemPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.ThemeSystem)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <ThemeSystemPropertyParser>(); }
public void GetPropertyParser_SelectMinDistanceIsSent_IntegerPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.SelectMinDistance)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <IntegerPropertyParser>(); }
public void GetPropertyParser_DropAcceptIsSent_FunctionPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.DropAccept)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <FunctionPropertyParser>(); }
public void GetPropertyParser_EventLongPressDelayIsSent_IntegerPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.EventLongPressDelay)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <IntegerPropertyParser>(); }
public void GetPropertyParser_EventOverlapIsSent_StringPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.EventOverlap)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <StringPropertyParser>(); }
public void GetPropertyParser_EventConstraintIsSent_ObjectPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.EventConstraint)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <ObjectPropertyParser>(); }
public void GetPropertyParser_DragRevertDurationIsSent_IntegerPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.DragRevertDuration)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <IntegerPropertyParser>(); }
public void GetPropertyParser_DragScrollIsSent_BoolPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.DragScroll)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <BoolPropertyParser>(); }
public void GetPropertyParser_EventDurationEditableIsSent_BoolPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.EventDurationEditable)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <BoolPropertyParser>(); }
public void GetPropertyParser_FirstDayIsSent_DayOfWeekPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.FirstDay)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <DayOfWeekPropertyParser>(); }
public void GetPropertyParser_NextDayThresholdIsSent_TimeSpanPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.NextDayThreshold)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <TimeSpanPropertyParser>(); }
public void GetPropertyParser_EventBackgroundColorIsSent_ColorPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.EventBackgroundColor)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <ColorPropertyParser>(); }
public void GetPropertyParser_BootstrapGlyphiconsIconsIsSent_ButtonIconsPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.BootstrapGlyphicons)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <ButtonIconsPropertyParser>(); }
public void GetPropertyParser_DefaultAllDayEventDurationIsSent_TimeSpanPropertyParserIsCreated() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.DefaultAllDayEventDuration)); IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.Should().BeOfType <TimeSpanPropertyParser>(); }
public XmlParser(string[] properties) { this.Parsers = new List <IPropertyParser>(); foreach (var property in properties) { var parser = PropertyParserFactory.Create(property); if (parser != null) { this.Parsers.Add(parser); } } }
public static IHtmlString FullCalendar(this HtmlHelper htmlHelper, Action <FullCalendarParameters> parameters) { var fullCalendarParameters = new FullCalendarParameters(); parameters(fullCalendarParameters); Dictionary <string, string> attributes = new Dictionary <string, string>(); foreach (var property in typeof(FullCalendarParameters).GetProperties()) { if (property.Name == nameof(FullCalendarParameters.Name) || property.Name == nameof(FullCalendarParameters.CssClass)) { continue; } IPropertyParser propertyParser = PropertyParserFactory.GetPropertyParser(property); propertyParser.AddPropertyToDictionary(fullCalendarParameters, ref attributes); } return(MvcHtmlString.Create(string.Format("<div {0} {1} class=\"fc {2}\" {3}></div>", !string.IsNullOrEmpty(fullCalendarParameters.Name) ? string.Format("id='{0}'", fullCalendarParameters.Name) : "", !string.IsNullOrEmpty(fullCalendarParameters.Name) ? string.Format("name='{0}'", fullCalendarParameters.Name) : "", fullCalendarParameters.CssClass, string.Join(" ", attributes.Select(x => x.Key + "=\"" + x.Value + "\""))))); }