Skip to content

Commit 8e2d92f

Browse files
Remove content around exposing Program
1 parent 30ec868 commit 8e2d92f

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

aspnetcore/test/integration-tests.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,6 @@ If the SUT's [environment](xref:fundamentals/environments) isn't set, the enviro
5555

5656
## Basic tests with the default WebApplicationFactory
5757

58-
59-
Expose the implicitly defined `Program` class to the test project by doing one of the following:
60-
61-
* Expose internal types from the web app to the test project. This can be done in the SUT project's file (`.csproj`):
62-
```xml
63-
<ItemGroup>
64-
<InternalsVisibleTo Include="MyTestProject" />
65-
</ItemGroup>
66-
```
67-
* Make the [`Program` class public using a partial class](https://github.com/dotnet/AspNetCore.Docs.Samples/blob/main/test/integration-tests/10.x/IntegrationTestsSample/src/RazorPagesProject/Program.cs) declaration:
68-
69-
```diff
70-
var builder = WebApplication.CreateBuilder(args);
71-
// ... Configure services, routes, etc.
72-
app.Run();
73-
+ public partial class Program { }
74-
```
75-
76-
The [sample app](https://github.com/dotnet/AspNetCore.Docs.Samples/tree/main/test/integration-tests/10.x/IntegrationTestsSample) uses the `Program` partial class approach.
77-
7858
<xref:Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory%601> is used to create a <xref:Microsoft.AspNetCore.TestHost.TestServer> for the integration tests. `TEntryPoint` is the entry point class of the SUT, usually `Program.cs`.
7959

8060
Test classes implement a *class fixture* interface ([`IClassFixture`](https://xunit.net/docs/shared-context#class-fixture)) to indicate the class contains tests and provide shared object instances across the tests in the class.

0 commit comments

Comments
 (0)