コード例 #1
0
        public void ConvertFromLocalizedStringEmptyString()
        {
            //arrange
            var editor = new EnumPropertyEditorEx(typeof(TestEnum1), null);

            editor.enumDescriptorCore = new DevExpress.ExpressApp.Utils.EnumDescriptor(typeof(TestEnum1));
            var inputString = "Test,Value";

            //act
            var resultString = editor.ConvertFromLocalizedString(inputString);
            var resultEnum   = Enum.Parse(typeof(TestEnum1), resultString);

            //assert
            Assert.AreEqual(TestEnum1.Test | TestEnum1.Value, resultEnum);
        }
コード例 #2
0
        public void ConvertFromLocalizedStringRepeatedEnums()
        {
            //arrange
            var editor = new EnumPropertyEditorEx(typeof(TestEnum2), null);

            editor.enumDescriptorCore = new DevExpress.ExpressApp.Utils.EnumDescriptor(typeof(TestEnum2));
            var inputString = "Air,Air/Water";

            //act
            var resultString = editor.ConvertFromLocalizedString(inputString);
            var resultEnum   = Enum.Parse(typeof(TestEnum2), resultString);

            //assert
            Assert.AreEqual(TestEnum2.AirTest | TestEnum2.AirWater, resultEnum);
        }