コード例 #1
0
        public void BitCharger_LengthConstruction_PropertiesAsExpected(Int32 actual, Int32 length, Int32 bytes, String content)
        {
            IBitCharger instance = new BitCharger(actual);

            Assert.That(instance.Capacity, Is.EqualTo(128));
            Assert.That(instance.Length, Is.EqualTo(length));
            Assert.That(instance.Bytes, Is.EqualTo(bytes));
            Assert.That(instance.Content, Is.EqualTo(content));
        }
コード例 #2
0
        public void BitCharger_StandardConstruction_PropertiesAsExpected()
        {
            IBitCharger instance = new BitCharger();

            Assert.That(instance.Capacity, Is.EqualTo(128));
            Assert.That(instance.Length, Is.Zero);
            Assert.That(instance.Bytes, Is.Zero);
            Assert.That(instance.Content, Is.Empty);
        }
コード例 #3
0
        private IBitCharger CreateInstance(Int32 length)
        {
            IBitCharger instance = new BitCharger(this.byteOrder?.Object);

            if (length > 0)
            {
                instance.SetBitAt(length - 1, false);
            }

            return(instance);
        }