public void ReadRows_AutoMappedCustomIndexEnumProperty_ReturnsExpected() { using var importer = Helpers.GetImporter("Primitives.xlsx"); ExcelSheet sheet = importer.ReadSheet(); sheet.ReadHeading(); CustomIndexEnumPropertyClass row1 = sheet.ReadRow <CustomIndexEnumPropertyClass>(); Assert.Equal(CustomEnum.a, row1.CustomIndex); Assert.Throws <ExcelMappingException>(() => sheet.ReadRow <CustomIndexEnumPropertyClass>()); }
public void ReadRows_CustomMappedCustomIndexEnumProperty_ReturnsExpected() { using var importer = Helpers.GetImporter("Primitives.xlsx"); importer.Configuration.RegisterClassMap <CustomCustomIndexEnumPropertyClassMap>(); ExcelSheet sheet = importer.ReadSheet(); sheet.ReadHeading(); CustomIndexEnumPropertyClass row1 = sheet.ReadRow <CustomIndexEnumPropertyClass>(); Assert.Equal(CustomEnum.a, row1.CustomIndex); CustomIndexEnumPropertyClass row2 = sheet.ReadRow <CustomIndexEnumPropertyClass>(); Assert.Equal(CustomEnum.B, row2.CustomIndex); }