Exemplo n.º 1
0
    public void GetIntGivesCorrectResult(int index, int bitCount, int offset, int result)
    {
        byte[] bytes = new byte[]
        {
            0x3B, 0x34, 0xA8, 0x4E,
            0xF2, 0x0A, 0xD7, 0xFE
        };

        var bdw = new BaseDataWindow(bytes, 8);

        bdw.GetInt(index, offset, bitCount).Should().Be(result);
    }
Exemplo n.º 2
0
    public void SetIntSetsCorrectValue(int index, int bitCount, int offset, int value, byte[] resultingArray)
    {
        byte[] bytes = new byte[]
        {
            0x3B, 0x34, 0xA8, 0x4E,
            0xF2, 0x0A, 0xD7, 0xFE
        };

        var bdw = new BaseDataWindow(bytes, 8);

        bdw.SetInt(index, offset, bitCount, value);

        bdw.Data.Should().Equal(resultingArray);
    }
Exemplo n.º 3
0
 public void GetMaskGivesCorrectResult(int bitCount, int result)
 {
     BaseDataWindow.GetMask(bitCount).Should().Be(result);
 }