public void SerializeAsJsonUsingNewtonsoft_Default_SerializerSet() { var builder = new TestProducerEndpointBuilder(); var endpoint = builder.SerializeAsJsonUsingNewtonsoft().Build(); endpoint.Serializer.Should().BeOfType <NewtonsoftJsonMessageSerializer>(); endpoint.Serializer.Should().NotBeSameAs(NewtonsoftJsonMessageSerializer.Default); }
public void SerializeAsJsonUsingNewtonsoft_UseFixedType_SerializerSet() { var builder = new TestProducerEndpointBuilder(); var endpoint = builder.SerializeAsJsonUsingNewtonsoft(serializer => serializer.UseFixedType <TestEventOne>()) .Build(); endpoint.Serializer.Should().BeOfType <NewtonsoftJsonMessageSerializer <TestEventOne> >(); }
public void SerializeAsJsonUsingNewtonsoft_WithEncoding_SerializerAndOptionsSet() { var builder = new TestProducerEndpointBuilder(); var endpoint = builder.SerializeAsJsonUsingNewtonsoft( serializer => serializer.WithEncoding(MessageEncoding.Unicode)).Build(); endpoint.Serializer.Should().BeOfType <NewtonsoftJsonMessageSerializer>(); endpoint.Serializer.As <NewtonsoftJsonMessageSerializer>().Encoding.Should().Be(MessageEncoding.Unicode); }
public void SerializeAsJsonUsingNewtonsoft_Configure_SerializerAndOptionsSet() { var builder = new TestProducerEndpointBuilder(); var endpoint = builder.SerializeAsJsonUsingNewtonsoft( serializer => serializer.Configure(settings => { settings.MaxDepth = 42; })).Build(); endpoint.Serializer.Should().BeOfType <NewtonsoftJsonMessageSerializer>(); endpoint.Serializer.As <NewtonsoftJsonMessageSerializer>().Settings.MaxDepth.Should().Be(42); }