Remove test that hits HTTP (#20476)

This commit is contained in:
Ryan Brandenburg 2020-04-03 11:28:27 -07:00 committed by GitHub
parent d513eea853
commit cb523d73e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 29 deletions

View File

@ -446,34 +446,5 @@ namespace Microsoft.DotNet.OpenApi.Add.Tests
var jsonFile = Path.Combine(_tempDir.Root, expectedJsonName);
Assert.False(File.Exists(jsonFile));
}
[Fact]
public void OpenApi_Add_URL_ActualResponse()
{
var project = CreateBasicProject(withOpenApi: false);
var app = GetApplication(realHttp: true);
var url = ActualUrl;
var run = app.Execute(new[] { "add", "url", url });
AssertNoErrors(run);
app = GetApplication(realHttp: true);
run = app.Execute(new[] { "add", "url", url });
AssertNoErrors(run);
// csproj contents
var csproj = new FileInfo(project.Project.Path);
using var csprojStream = csproj.OpenRead();
using var reader = new StreamReader(csprojStream);
var content = reader.ReadToEnd();
var escapedPkgRef = Regex.Escape("<PackageReference Include=\"NSwag.ApiDescription.Client\" Version=\"");
Assert.Single(Regex.Matches(content, escapedPkgRef));
var escapedApiRef = Regex.Escape($"SourceUrl=\"{url}\"");
Assert.Single(Regex.Matches(content, escapedApiRef));
Assert.Contains(
$@"<OpenApiReference Include=""api-with-examples.yaml"" SourceUrl=""{ActualUrl}"" />", content);
}
}
}