public void AddPropertyToDictionary_ValueIsIntegerDefault_PropertyIsNotAdded() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.LongPressDelay)); FullCalendarParameters parameters = new FullCalendarParameters(); IntegerPropertyParser parser = new IntegerPropertyParser(property); Dictionary <string, string> target = new Dictionary <string, string>(); parser.AddPropertyToDictionary(parameters, ref target); target.Should().BeEmpty(); }
public void AddPropertyToDictionary_DictionaryIsNotEmpty_PropertyIsAddedAsSerializedObject() { PropertyInfo property = typeof(FullCalendarParameters).GetProperties().Single(x => x.Name == nameof(FullCalendarParameters.EventLongPressDelay)); FullCalendarParameters parameters = new FullCalendarParameters { EventLongPressDelay = 2000 }; IntegerPropertyParser parser = new IntegerPropertyParser(property); Dictionary <string, string> target = new Dictionary <string, string>(); parser.AddPropertyToDictionary(parameters, ref target); target.Should().Contain("data-fc-EventLongPressDelay", "2000"); }