Пример #1
0
        public void TestBooleanSerializerDecode()
        {
            var serializer = new BooleanValueSerializer();

            int pos;
            var action = new Action(() => serializer.Decode(new byte[1], 0, out pos));

            action.Should().Throw <NotSupportedException>();
        }
Пример #2
0
        public void TestBooleanSerializerEncode()
        {
            var serializer = new BooleanValueSerializer();

            // according to http://opensoundcontrol.org/spec-1_0
            // "No bytes are allocated in the argument data."

            var stream = new MemoryStream();

            serializer.Encode(stream, true).Should().Be(0);
            stream.ToArray().Length.Should().Be(0);

            stream = new MemoryStream();
            serializer.Encode(stream, false).Should().Be(0);
            stream.ToArray().Length.Should().Be(0);
        }