Exemplo n.º 1
0
 public void Transform()
 {
     string transformed = _transformer.Transform(
         _swagger,
         _reRouteOptions,
         string.Empty);
 }
        public void TransferDownstreamSwaggerToUpstreamFormat(TestCase testData)
        {
            var transformer = new SwaggerJsonTransformer();

            string transformed = transformer.Transform(
                testData.DownstreamSwagger.ToString(),
                testData.Routes,
                testData.HostOverride);

            AreEqual(transformed, testData.ExpectedTransformedSwagger, testData.FileName);
        }
Exemplo n.º 3
0
        private async Task TransformAndCheck(
            IEnumerable <ReRouteOptions> reroutes,
            string swaggerBaseFileName,
            string expectedSwaggerFileName)
        {
            var    transformer = new SwaggerJsonTransformer();
            string swaggerBase = await GetBaseSwagger(swaggerBaseFileName);

            var transfomed = transformer.Transform(swaggerBase, reroutes);

            await AreEquel(transfomed, expectedSwaggerFileName);
        }
Exemplo n.º 4
0
        private async Task TransformAndCheck(
            IEnumerable <ReRouteOptions> reroutes,
            string openApiBaseFileName,
            string expectedOpenApiFileName,
            string servers = "")
        {
            var    transformer = new SwaggerJsonTransformer();
            string openApiBase = await GetBaseOpenApi(openApiBaseFileName);

            var transformed = transformer.Transform(openApiBase, reroutes, servers);

            await AreEqual(transformed, expectedOpenApiFileName);
        }