Exemplo n.º 1
0
        public void WriteU4(uint value)
        {
            var destination = new BufferDataDestination();
            var writer      = new BigEndianWriter(destination);

            writer.WriteU4(value);

            Verify(value, destination);
        }
Exemplo n.º 2
0
        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);
Exemplo n.º 3
0
        public void DataWrittenToDestination()
        {
            var destination = new BufferDataDestination();
            var writer      = new BigEndianWriter(destination);

            writer.WriteU4(0xcafebabe);

            destination.Buffer.ToArray().Should().Equal(0xca, 0xfe, 0xba, 0xbe);
        }
Exemplo n.º 4
0
        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);
        }