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); }
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); }
public void GetMaskGivesCorrectResult(int bitCount, int result) { BaseDataWindow.GetMask(bitCount).Should().Be(result); }