Пример #1
0
        public async Task ReadFromProtoBufAsync_Generic_Test()
        {
            var content = new StreamProtoBufHttpContent();

            content.WriteObject(SimpleType.Create(), _typeModel);

            var model = await content.ReadFromProtoBufAsync <SimpleType>(_typeModel);

            model.Verify();
        }
Пример #2
0
        public async Task ReadFromProtoBufAsync_Generic_NullObject_Test()
        {
            var content = new StreamProtoBufHttpContent();

            content.WriteObject <SimpleType>(null !, _typeModel);

            var model = await content.ReadFromProtoBufAsync <SimpleType>(_typeModel);

            Assert.Null(model);
        }
Пример #3
0
        public async Task ReadFromProtoBufAsync_Test()
        {
            var content = new StreamProtoBufHttpContent();

            content.WriteObject(SimpleType.Create(), _typeModel);

            var model = await content.ReadFromProtoBufAsync(typeof(SimpleType), _typeModel);

            var simpleType = Assert.IsType <SimpleType>(model);

            simpleType.Verify();
        }