Esempio n. 1
0
        internal async Task <BitResult> Run()
        {
            var cmd = new BitCommand();
            var ctx = new BitContext();

            return(await cmd.Main(ctx));
        }
Esempio n. 2
0
        public void BitContext_GetBits_Test()
        {
            var target = new BitContext(null);

            const int expected = 0;
            var       actual   = target.GetBits;

            actual.Should().Be(expected);
        }
Esempio n. 3
0
        public void HasBit_Enum_Fact()
        {
            var fake = new FakeEntity(1, "Fact");

            var ctx = new BitContext(fake);

            ctx.SetBit(FactEnum.Fact2);

            ctx.HasBit(FactEnum.Fact2).Should().BeTrue();
        }
Esempio n. 4
0
        public void HasBitFact()
        {
            var fake = new FakeEntity(1, "Fact");

            var ctx = new BitContext(fake);

            ctx.SetBit(1);

            ctx.HasBit(1).Should().BeTrue();
        }
Esempio n. 5
0
        public void GetBits_Fact()
        {
            var fake = new FakeEntity(1, "Fact");

            var ctx = new BitContext(fake);

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

            ctx.GetBits.Should().Be(3);
        }
Esempio n. 6
0
        public void BitContext_HasBitEnum_Test()
        {
            var target = new BitContext(null);

            target.SetBits(11);

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

            actual.Should().Be(expected);
        }
Esempio n. 7
0
        public void SetBits_Fact()
        {
            var fake = new FakeEntity(1, "Fact");

            var ctx = new BitContext(fake);

            const int val = (int)(FactEnum.Fact1 | FactEnum.Fact2);

            ctx.SetBits(val);

            ctx.GetBits.Should().Be(val);
        }
Esempio n. 8
0
        public void BitContext_SetBitEnum_Test()
        {
            var target = new BitContext(null);

            target.SetBits(8);
            target.SetBit(EnumTest.Bitfour);

            const int expected = 12;
            var       actual   = target.GetBits;

            actual.Should().Be(expected);
        }
Esempio n. 9
0
        public void BitContext_SetBitInt_Test()
        {
            var target = new BitContext(null);

            target.SetBits(8);
            target.SetBit(16);

            const int expected = 24;
            var       actual   = target.GetBits;

            actual.Should().Be(expected);
        }
Esempio n. 10
0
        public void BitContext_UnsetBitInt_Test()
        {
            var target = new BitContext(null);

            target.SetBits(11);
            target.UnsetBit(2);

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

            actual.Should().Be(expected);
        }
Esempio n. 11
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();
        }
Esempio n. 12
0
 public PlayerRepository(BitContext context)
 {
     _context = context;
 }
Esempio n. 13
0
 public TeamRepository(BitContext context)
 {
     _context = context;
 }
Esempio n. 14
0
 public virtual Task <BitResult> Main(BitContext context) => throw new NotImplementedException();