Exemplo n.º 1
0
        public void GetEndpoint_ContextWithoutFeature_ReturnsNull()
        {
            // Arrange
            var context = new DefaultProtoContext();

            // Act
            var endpoint = context.GetEndpoint();

            // Assert
            Assert.Null(endpoint);
        }
Exemplo n.º 2
0
        public void SetAndGetEndpoint_Roundtrip_EndpointIsRoundtrip()
        {
            // Arrange
            var context         = new DefaultProtoContext();
            var initialEndpoint = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint");

            // Act
            context.SetEndpoint(initialEndpoint);
            var endpoint = context.GetEndpoint();

            // Assert
            Assert.Equal(initialEndpoint, endpoint);
        }
Exemplo n.º 3
0
        public void GetEndpoint_ContextWithFeatureAndNullEndpoint_ReturnsNull()
        {
            // Arrange
            var context = new DefaultProtoContext();

            context.Features.Set <IEndpointFeature>(new EndpointFeature
            {
                Endpoint = null
            });

            // Act
            var endpoint = context.GetEndpoint();

            // Assert
            Assert.Null(endpoint);
        }
Exemplo n.º 4
0
        public void GetEndpoint_ContextWithFeatureAndEndpoint_ReturnsNull()
        {
            // Arrange
            var context = new DefaultProtoContext();
            var initial = new Endpoint(c => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint");

            context.Features.Set <IEndpointFeature>(new EndpointFeature
            {
                Endpoint = initial
            });

            // Act
            var endpoint = context.GetEndpoint();

            // Assert
            Assert.Equal(initial, endpoint);
        }