mirror of https://github.com/Squidex/squidex.git
24 changed files with 135 additions and 80 deletions
@ -0,0 +1,32 @@ |
|||||
|
// ==========================================================================
|
||||
|
// EnvelopeTests.cs
|
||||
|
// Squidex Headless CMS
|
||||
|
// ==========================================================================
|
||||
|
// Copyright (c) Squidex Group
|
||||
|
// All rights reserved.
|
||||
|
// ==========================================================================
|
||||
|
|
||||
|
using Squidex.Infrastructure.Json; |
||||
|
using Squidex.Infrastructure.TestHelpers; |
||||
|
using Xunit; |
||||
|
|
||||
|
namespace Squidex.Infrastructure.CQRS.Events |
||||
|
{ |
||||
|
public class EnvelopeTests |
||||
|
{ |
||||
|
public class MyEvent : IEvent |
||||
|
{ |
||||
|
public int Value { get; set; } |
||||
|
} |
||||
|
|
||||
|
[Fact] |
||||
|
public void Should_serialize_and_deserialize() |
||||
|
{ |
||||
|
var value = new Envelope<IEvent>(new MyEvent { Value = 1 }); |
||||
|
|
||||
|
var deserialized = value.SerializeAndDeserializeAndReturn(new PropertiesBagConverter<EnvelopeHeaders>()); |
||||
|
|
||||
|
Assert.Equal(1, value.To<MyEvent>().Payload.Value); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue