예제 #1
0
        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);
        }
예제 #2
0
        public void SerializeAsJsonUsingNewtonsoft_UseFixedType_SerializerSet()
        {
            var builder = new TestProducerEndpointBuilder();

            var endpoint = builder.SerializeAsJsonUsingNewtonsoft(serializer => serializer.UseFixedType <TestEventOne>())
                           .Build();

            endpoint.Serializer.Should().BeOfType <NewtonsoftJsonMessageSerializer <TestEventOne> >();
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }