Skip to content

Commit dbafaf7

Browse files
committed
#280 Upgraded the NuGet packages
Updated the readme file and the build pipelines accordingly
1 parent d82b6ad commit dbafaf7

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ Install-Package Xunit.Microsoft.DependencyInjection
2323
The abstract class of `Xunit.Microsoft.DependencyInjection.Abstracts.TestBedFixture` contains the necessary functionalities to add services and configurations to Microsoft's dependency injection container. Your concrete test fixture class must derive from this abstract class and implement the following two abstract methods:
2424

2525
```csharp
26-
protected abstract IEnumerable<string> GetConfigurationFiles();
27-
protected abstract void AddServices(IServiceCollection services, IConfiguration configuration);
26+
protected abstract void AddServices(IServiceCollection services, IConfiguration? configuration);
27+
protected abstract IEnumerable<TestAppSettings> GetTestAppSettings();
28+
protected abstract ValueTask DisposeAsyncCore();
2829
```
2930

3031
`GetConfigurationFiles(...)` method returns a collection of the configuration files in your Xunit test project to the framework. `AddServices(...)` method must be used to wire up the implemented services.
@@ -52,7 +53,7 @@ To access async scopes simply call the following method in the abstract fixture
5253
public AsyncServiceScope GetAsyncScope<T>(ITestOutputHelper testOutputHelper)
5354
```
5455

55-
### Accessing the keyed wired up services in .NET 8.0
56+
### Accessing the keyed wired up services in .NET 9.0
5657

5758
You can call the following method to access the keyed already-wired up services:
5859

azure-pipeline-PR.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ steps:
1717
displayName: 'Use .NET 8.0 sdk'
1818
inputs:
1919
packageType: sdk
20-
version: 9.0.100
20+
version: 9.0.102
2121
installationPath: $(Agent.ToolsDirectory)/dotnet
2222
- script: echo Started restoring the source code
2323
- task: DotNetCoreCLI@2

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ steps:
2525
displayName: 'Use .NET 8.0 sdk'
2626
inputs:
2727
packageType: sdk
28-
version: 9.0.100
28+
version: 9.0.102
2929
installationPath: $(Agent.ToolsDirectory)/dotnet
3030
- script: echo Started restoring the source code
3131
- task: DotNetCoreCLI@2

examples/Xunit.Microsoft.DependencyInjection.ExampleTests/Xunit.Microsoft.DependencyInjection.ExampleTests.csproj

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.0" />
13+
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="9.0.1" />
1414
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
15-
<PackageReference Include="xunit" Version="2.9.2" />
16-
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
15+
<PackageReference Include="xunit" Version="2.9.3" />
16+
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
1717
<PrivateAssets>all</PrivateAssets>
1818
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1919
</PackageReference>
20-
<PackageReference Include="coverlet.collector" Version="6.0.2">
20+
<PackageReference Include="coverlet.collector" Version="6.0.4">
2121
<PrivateAssets>all</PrivateAssets>
2222
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2323
</PackageReference>
24-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
25-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0" />
26-
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.0" />
27-
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0" />
28-
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.0" />
29-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0" />
30-
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
24+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.1" />
25+
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.1" />
26+
<PackageReference Include="Microsoft.Extensions.Options" Version="9.0.1" />
27+
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.1" />
28+
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.1" />
29+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.1" />
30+
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.1" />
3131
</ItemGroup>
3232
<ItemGroup>
3333
<None Remove="appsettings.json" />

src/Abstracts/TestBedFixture.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ public async ValueTask DisposeAsync()
8484

8585
protected abstract void AddServices(IServiceCollection services, IConfiguration? configuration);
8686
protected abstract IEnumerable<TestAppSettings> GetTestAppSettings();
87+
protected abstract ValueTask DisposeAsyncCore();
8788

8889
protected virtual ILoggingBuilder AddLoggingProvider(ILoggingBuilder loggingBuilder, ILoggerProvider loggerProvider)
8990
=> loggingBuilder.AddProvider(loggerProvider);
@@ -127,7 +128,5 @@ protected virtual void Dispose(bool disposing)
127128
// TODO: set large fields to null
128129
_disposedValue = true;
129130
}
130-
}
131-
132-
protected abstract ValueTask DisposeAsyncCore();
131+
}
133132
}

src/Xunit.Microsoft.DependencyInjection.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
<PackageReadmeFile>README.md</PackageReadmeFile>
88
</PropertyGroup>
99
<ItemGroup>
10-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />
11-
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.0" />
10+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.1" />
11+
<PackageReference Include="Microsoft.Extensions.Logging" Version="9.0.1" />
1212
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
13-
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.0" />
14-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0" />
15-
<PackageReference Include="xunit.core" Version="2.9.2" />
16-
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.0" />
13+
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.1" />
14+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.1" />
15+
<PackageReference Include="xunit.core" Version="2.9.3" />
16+
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.1" />
1717
</ItemGroup>
1818
<ItemGroup>
1919
<None Include="..\README.md" Pack="true" PackagePath="\" />

0 commit comments

Comments
 (0)