public void WriteU4(uint value) { var destination = new BufferDataDestination(); var writer = new BigEndianWriter(destination); writer.WriteU4(value); Verify(value, destination); }
public void DataWrittenToDestination() { var stream = new MemoryStream(); var destination = new StreamDataDestination(stream); var writer = new BigEndianWriter(destination); writer.WriteU4(0xcafebabe); stream.ToArray()[..4].Should().Equal(0xca, 0xfe, 0xba, 0xbe);
public void DataWrittenToDestination() { var destination = new BufferDataDestination(); var writer = new BigEndianWriter(destination); writer.WriteU4(0xcafebabe); destination.Buffer.ToArray().Should().Equal(0xca, 0xfe, 0xba, 0xbe); }
public void DataWrittenToDestination() { string path = Path.GetRandomFileName(); var destination = new FileDataDestination(path); var writer = new BigEndianWriter(destination); writer.WriteU4(0xcafebabe); destination.Dispose(); File.ReadAllBytes(path).Should().Equal(0xca, 0xfe, 0xba, 0xbe); }