Example #1
0
        public async Task EndToEndValue(T edc, Action <CT> action, bool defaultPropertiesOnly)
        {
            var ed = new EventData <int>(NewtonsoftJsonEventDataSerializerTest.CreateEventMetadata())
            {
                Value = 88
            };
            var ce = await edc.ConvertToAsync(ed);

            Assert.NotNull(ce);

            action(ce);

            var md = await edc.GetMetadataAsync(ce);

            Assert.NotNull(md);
            NewtonsoftJsonEventDataSerializerTest.AssertEventMetadata(md, defaultPropertiesOnly);

            var ed2 = await edc.ConvertFromAsync(typeof(int), ce);

            Assert.NotNull(ed2);
            NewtonsoftJsonEventDataSerializerTest.AssertEventMetadata(ed2, defaultPropertiesOnly);
            Assert.True(ed2.HasValue);
            Assert.AreEqual(88, ed2.GetValue());
            Assert.AreEqual(88, ((EventData <int>)ed2).Value);
        }
Example #2
0
        public async Task EndToEnd(T edc, Action <CT> action, bool defaultPropertiesOnly)
        {
            var ed = new EventData(NewtonsoftJsonEventDataSerializerTest.CreateEventMetadata());
            var ce = await edc.ConvertToAsync(ed);

            Assert.NotNull(ce);

            action(ce);

            var md = await edc.GetMetadataAsync(ce);

            Assert.NotNull(md);
            NewtonsoftJsonEventDataSerializerTest.AssertEventMetadata(md, defaultPropertiesOnly);

            var ed2 = await edc.ConvertFromAsync(ce);

            Assert.NotNull(ed2);
            NewtonsoftJsonEventDataSerializerTest.AssertEventMetadata(ed2, defaultPropertiesOnly);
        }