예제 #1
0
        public void ShouldIgnoreNonThirdPartyAttributeDataEntries(ProtoBuf.Share.DataEntry.Types.Type dataEntryType)
        {
            var dataEntry = new DataEntry
            {
                Type  = dataEntryType,
                Value = ByteString.CopyFromUtf8("value")
            };

            Assert.IsNull(DataEntryConverter.ConvertDataEntry(dataEntry));
        }
예제 #2
0
        public void ShouldThrowExtraDataExceptionForInvalidProtobuf()
        {
            var dataEntry = new ProtoBuf.Share.DataEntry
            {
                Value = ByteString.CopyFromUtf8(",̆"),
                Type  = DataEntry.Types.Type.ThirdPartyAttribute
            };

            Assert.ThrowsException <ExtraDataException>(() =>
            {
                DataEntryConverter.ConvertDataEntry(dataEntry);
            });
        }