Example #1
0
        public void ConvertEnumToDictionary <T>(
            T dummyForT,
            int expectedCount,
            DropDownFirstItemType dropDownFirstItemType,
            bool useDescriptionAttribute,
            bool includeDefault,
            SortDirectionType sortDirectionType,
            bool byFlagIncludeBase,
            bool byFlagIncludeCombined)
            where T : Enum
        {
            // Arrange
            var enumType = dummyForT.GetType();

            // Act
            var actual = EnumHelper.ConvertEnumToDictionary(
                enumType,
                dropDownFirstItemType,
                useDescriptionAttribute,
                includeDefault,
                sortDirectionType,
                byFlagIncludeBase,
                byFlagIncludeCombined);

            // Assert
            actual.Should().NotBeNull().And.HaveCount(expectedCount);
        }
 public UserCollectAnswerViewModel()
 {
     GenderDictionary = EnumHelper.ConvertEnumToDictionary(typeof(Gender));
     DinnerDictionary = EnumHelper.ConvertEnumToDictionary(typeof(Dinner));
 }