AqlaSolutions/AqlaSerializer

Enum With Duplicate Items

Closed this issue · 2 comments

Does Aqla support enum with duplicate items? The following test fails on the assertion.

        enum EnumWithDuplicateItems
        {
            Min = 0,
            Current = Min,
            Market,
            Max = Market,
        }

        [Test]
        public void TestEnumWithDuplicateItems()
        {
            var clone = Serializer.DeepClone(EnumWithDuplicateItems.Market);
            Assert.Equal(EnumWithDuplicateItems.Market, clone);
        }

I can't reproduce this, it works for me.

Interesting. I have to change it to make the test work:

        enum EnumWithDuplicateItems
        {
            Current = 0,
            Market,
            Min = Current,
            Max = Market,
        }