示例#1
0
            public void TestInt32ToAsObject()
            {
                Flag1.AsObject().ShouldBeEquivalentTo((Object)Flag1);
                Flag1Flag2.AsObject().ShouldBeEquivalentTo((Object)(Flag1 | Flag2));
                var objResult = Enums.AsObject <TestEnum>((int)(0x000008000 | 0x000010000)) as TestEnum? ?? TestEnum.Ten;

                objResult.ShouldBeEquivalentTo(Flag1 | Flag2);
            }
示例#2
0
            public void TestUInt64ToAsObject()
            {
                Flag1.AsObject().ShouldBeEquivalentTo((Object)Flag1);
                Flag1Flag2.AsObject().ShouldBeEquivalentTo((Object)(Flag1 | Flag2));
                var objResult = Enums.AsObject <TestEnum>((ulong)(0x400000000000000 | 0x800000000000000)) as TestEnum? ?? TestEnum.Ten;

                objResult.ShouldBeEquivalentTo(Flag1 | Flag2);
            }
示例#3
0
            public void TestByteToAsObject()
            {
                Flag1.AsObject().ShouldBeEquivalentTo((Object)Flag1);
                Flag1Flag2.AsObject().ShouldBeEquivalentTo((Object)(Flag1 | Flag2));
                var objResult = Enums.AsObject <TestEnum>((byte)(0x000000001 | 0x000000002)) as TestEnum? ?? TestEnum.Ten;

                objResult.ShouldBeEquivalentTo(Flag1 | Flag2);
            }