Пример #1
0
        public void Primary_and_expanded_instances_are_equal_if_primary_slot_is_equal_and_subslot_is_zero()
        {
            var slotNumber = (byte)(Fixture.Create <byte>() & 0x03);
            var sut1       = new SlotNumber(slotNumber);
            var sut2       = new SlotNumber((byte)(slotNumber | 0x80));

            Assert.True(sut1 == sut2);
            Assert.True(sut1.Equals(sut2));
        }
Пример #2
0
        public void Can_be_compared_to_byte_and_unused_bits_are_ignored()
        {
            var slotNumber = (byte)(Fixture.Create <byte>() | 0x80);
            var slotNumberWithExtraBits = (byte)(slotNumber | 0x70);
            var sut = new SlotNumber(slotNumber);

            Assert.True(slotNumberWithExtraBits == sut);
            Assert.True(sut.Equals(slotNumberWithExtraBits));
        }
Пример #3
0
        public void Two_expanded_instances_are_equal_if_slot_and_subslot_are_equal()
        {
            var slotNumber = (byte)(Fixture.Create <byte>() | 0x80);
            var sut1       = new SlotNumber(slotNumber);
            var sut2       = new SlotNumber(slotNumber);

            Assert.True(sut1 == sut2);
            Assert.True(sut1.Equals(sut2));
        }