Esempio n. 1
0
        public void DeserializeJson_WithSetMessageType_TypedSerializerSet()
        {
            var builder = new TestConsumerEndpointBuilder(typeof(TestEventOne));

            var endpoint = builder.DeserializeJson().Build();

            endpoint.Serializer.Should().BeOfType <JsonMessageSerializer <TestEventOne> >();
        }
        public void DeserializeJson_UseFixedType_SerializerSet()
        {
            var builder = new TestConsumerEndpointBuilder();

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

            endpoint.Serializer.Should().BeOfType <JsonMessageSerializer <TestEventOne> >();
        }
Esempio n. 3
0
        public void DeserializeJson_Default_SerializerSet()
        {
            var builder = new TestConsumerEndpointBuilder();

            var endpoint = builder.DeserializeJson().Build();

            endpoint.Serializer.Should().BeOfType <JsonMessageSerializer>();
            endpoint.Serializer.Should().NotBeSameAs(JsonMessageSerializer.Default);
        }
Esempio n. 4
0
        public void DeserializeJson_WithOptions_SerializerAndOptionsSet()
        {
            var builder = new TestConsumerEndpointBuilder();

            var endpoint = builder.DeserializeJson(
                serializer => serializer.WithOptions(
                    new JsonSerializerOptions
            {
                MaxDepth = 42
            })).Build();

            endpoint.Serializer.Should().BeOfType <JsonMessageSerializer>();
            endpoint.Serializer.As <JsonMessageSerializer>().Options.MaxDepth.Should().Be(42);
        }