Beispiel #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));
        }
Beispiel #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);
            });
        }