public void EncodeBinary_NoData()
        {
            var cloudEvent = CreateSampleEvent();

            cloudEvent.Data = null;

            var converter = new ProtobufJsonCloudEventFormatter <StorageObjectData>();

            Assert.Empty(converter.EncodeBinaryModeEventData(cloudEvent).ToArray());
        }
        public void EncodeBinary()
        {
            var cloudEvent    = CreateSampleEvent();
            var expectedBytes = TestResourceHelper.LoadBytes("binary-mode-body.json");

            var converter   = new ProtobufJsonCloudEventFormatter <StorageObjectData>();
            var actualBytes = converter.EncodeBinaryModeEventData(cloudEvent).ToArray();

            AssertJsonBytesEqual(expectedBytes, actualBytes);
        }