Exemplo n.º 1
0
        public void BitContext_UnsetBitEnum_Test()
        {
            var target = new BitContext(null);

            target.SetBits(11);
            target.UnsetBit(EnumTest.Bittwo);

            const bool expected = false;
            var        actual   = target.HasBit(EnumTest.Bittwo);

            actual.Should().Be(expected);
        }
Exemplo n.º 2
0
        public void UnsetBit_Integer_Fact()
        {
            var fake = new FakeEntity(1, "Fact");

            var ctx = new BitContext(fake);

            ctx.SetBit(4);
            ctx.SetBit(2);

            ctx.HasBit(4).Should().BeTrue();

            ctx.UnsetBit(2);
            ctx.HasBit(4).Should().BeTrue();
            ctx.HasBit(2).Should().BeFalse();
        }
Exemplo n.º 3
0
        public void UnsetBit_Enum_Fact()
        {
            var fake = new FakeEntity(1, "Fact");

            var ctx = new BitContext(fake);

            ctx.SetBit(FactEnum.Fact1);
            ctx.SetBit(FactEnum.Fact2);

            ctx.HasBit(FactEnum.Fact2).Should().BeTrue();

            ctx.UnsetBit(FactEnum.Fact1);

            ctx.HasBit(FactEnum.Fact2).Should().BeTrue();
            ctx.HasBit(FactEnum.Fact1).Should().BeFalse();
        }