예제 #1
0
        private static MatcherEndpoint CreateEndpoint(string template, ConsumesMetadata consumesMetadata)
        {
            var metadata = new List <object>();

            if (consumesMetadata != null)
            {
                metadata.Add(consumesMetadata);
            }

            return(new MatcherEndpoint(
                       (next) => null,
                       RoutePatternFactory.Parse(template),
                       0,
                       new EndpointMetadataCollection(metadata),
                       $"test: {template} - {string.Join(", ", consumesMetadata?.ContentTypes ?? Array.Empty<string>())}"));
        }
        private static RouteEndpoint CreateEndpoint(string template, ConsumesMetadata consumesMetadata, params object[] more)
        {
            var metadata = new List <object>();

            if (consumesMetadata != null)
            {
                metadata.Add(consumesMetadata);
            }

            if (more != null)
            {
                metadata.AddRange(more);
            }

            return(new RouteEndpoint(
                       (context) => Task.CompletedTask,
                       RoutePatternFactory.Parse(template),
                       0,
                       new EndpointMetadataCollection(metadata),
                       $"test: {template} - {string.Join(", ", consumesMetadata?.ContentTypes ?? Array.Empty<string>())}"));
        }