docs(dotnet): use modern namespace syntax for api testing snippets (#17271)

This commit is contained in:
Max Schmitt 2022-09-12 23:17:27 +02:00 committed by GitHub
parent c7367b7065
commit ab4876242f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,11 +39,10 @@ using Microsoft.Playwright.NUnit;
using Microsoft.Playwright;
using NUnit.Framework;
namespace PlaywrightTests
{
namespace PlaywrightTests;
public class TestGitHubAPI : PlaywrightTest
{
public class TestGitHubAPI : PlaywrightTest
{
static string API_TOKEN = Environment.GetEnvironmentVariable("GITHUB_API_TOKEN");
private IAPIRequestContext Request = null;
@ -75,7 +74,6 @@ namespace PlaywrightTests
{
await Request.DisposeAsync();
}
}
}
```
@ -91,12 +89,11 @@ using Microsoft.Playwright.NUnit;
using Microsoft.Playwright;
using NUnit.Framework;
namespace PlaywrightTests
{
namespace PlaywrightTests;
[TestFixture]
public class TestGitHubAPI : PlaywrightTest
{
[TestFixture]
public class TestGitHubAPI : PlaywrightTest
{
static string REPO = "test-repo-2";
static string USER = Environment.GetEnvironmentVariable("GITHUB_USER");
static string API_TOKEN = Environment.GetEnvironmentVariable("GITHUB_API_TOKEN");
@ -160,7 +157,6 @@ namespace PlaywrightTests
}
// ...
}
}
```
@ -217,12 +213,11 @@ using Microsoft.Playwright.NUnit;
using Microsoft.Playwright;
using NUnit.Framework;
namespace PlaywrightTests
{
namespace PlaywrightTests;
[TestFixture]
public class TestGitHubAPI : PlaywrightTest
{
[TestFixture]
public class TestGitHubAPI : PlaywrightTest
{
static string REPO = "test-repo-2";
static string USER = Environment.GetEnvironmentVariable("GITHUB_USER");
static string API_TOKEN = Environment.GetEnvironmentVariable("GITHUB_API_TOKEN");
@ -333,7 +328,6 @@ namespace PlaywrightTests
var resp = await Request.DeleteAsync("/repos/" + USER + "/" + REPO);
Assert.True(resp.Ok);
}
}
}
```