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,8 +39,7 @@ using Microsoft.Playwright.NUnit;
using Microsoft.Playwright;
using NUnit.Framework;
namespace PlaywrightTests
{
namespace PlaywrightTests;
public class TestGitHubAPI : PlaywrightTest
{
@ -76,7 +75,6 @@ namespace PlaywrightTests
await Request.DisposeAsync();
}
}
}
```
### Write tests
@ -91,8 +89,7 @@ using Microsoft.Playwright.NUnit;
using Microsoft.Playwright;
using NUnit.Framework;
namespace PlaywrightTests
{
namespace PlaywrightTests;
[TestFixture]
public class TestGitHubAPI : PlaywrightTest
@ -161,7 +158,6 @@ namespace PlaywrightTests
// ...
}
}
```
### Setup and teardown
@ -217,8 +213,7 @@ using Microsoft.Playwright.NUnit;
using Microsoft.Playwright;
using NUnit.Framework;
namespace PlaywrightTests
{
namespace PlaywrightTests;
[TestFixture]
public class TestGitHubAPI : PlaywrightTest
@ -334,7 +329,6 @@ namespace PlaywrightTests
Assert.True(resp.Ok);
}
}
}
```
## Prepare server state via API calls