23 references to FlagsEnum
Microsoft.AspNetCore.Mvc.Core.Test (23)
ModelBinding\ModelBindingHelperTest.cs (23)
1143[InlineData(new object[] { new object[] { 1, 2 }, new[] { FlagsEnum.Value1, FlagsEnum.Value2 } })]
1144[InlineData(new object[] { new[] { "Value1", "Value2" }, new[] { FlagsEnum.Value1, FlagsEnum.Value2 } })]
1145[InlineData(new object[] { new object[] { 5, 2 }, new[] { FlagsEnum.Value1 | FlagsEnum.Value4, FlagsEnum.Value2 } })]
1146public void ConvertTo_ConvertsFlagsEnumArrays(object value, FlagsEnum[] expected)
1151var outValue = ModelBindingHelper.ConvertTo(value, typeof(FlagsEnum[]), culture: null);
1154var result = Assert.IsType<FlagsEnum[]>(outValue);
1312[InlineData(new object[] { 2, FlagsEnum.Value2 })]
1313[InlineData(new object[] { 5, FlagsEnum.Value1 | FlagsEnum.Value4 })]
1314[InlineData(new object[] { 15, FlagsEnum.Value1 | FlagsEnum.Value2 | FlagsEnum.Value4 | FlagsEnum.Value8 })]
1315[InlineData(new object[] { 16, (FlagsEnum)16 })]
1316[InlineData(new object[] { 0, (FlagsEnum)0 })]
1317[InlineData(new object[] { null, (FlagsEnum)0 })]
1318[InlineData(new object[] { "Value1,Value2", (FlagsEnum)3 })]
1319[InlineData(new object[] { "Value1,Value2,value4, value8", (FlagsEnum)15 })]
1325var outValue = ModelBindingHelper.ConvertTo<FlagsEnum>(value, culture: null);