Skip to content

Commit dd9d9b5

Browse files
authored
Merge pull request #96 from Umplify:issue_95
Updated copyright year and conducted a slight code clean up. Wired up environment variables too. #95
2 parents 8f1ff70 + cdae021 commit dd9d9b5

File tree

4 files changed

+41
-43
lines changed

4 files changed

+41
-43
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Also, the test class should be decorated by the following attribute:
5050
## Running tests in order
5151
The library has a bonus feature that simplifies running tests in order. The test class does not have to be derived from ```TestBed<T>``` class though and it can apply to all Xunit classes.
5252

53-
Decorate your Xunit test class with the following attribute and associate ```TestOrder(...)``` with ```Fact```and ```Theory```:
53+
Decorate your Xunit test class with the following attribute and associate ```TestOrder(...)``` with ```Fact``` and ```Theory```:
5454

5555
```csharp
5656
[TestCaseOrderer("Xunit.Microsoft.DependencyInjection.TestsOrder.TestPriorityOrderer", "Xunit.Microsoft.DependencyInjection")]

src/Abstracts/TestBedFixture.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ public IServiceProvider GetServiceProvider(ITestOutputHelper testOutputHelper)
3939
public T? GetService<T>(ITestOutputHelper testOutputHelper)
4040
=> GetServiceProvider(testOutputHelper).GetService<T>();
4141

42-
[Obsolete("GetConfigurationFile() method is now deprecated. Please override GetConfigurationFiles() method instead and yield return your current settings file name e.g. 'appsettings.json'.", true)]
43-
protected virtual string GetConfigurationFile() => throw new NotSupportedException();
4442
protected abstract void AddServices(IServiceCollection services, IConfiguration? configuration);
4543
protected abstract IEnumerable<string> GetConfigurationFiles();
4644

@@ -62,6 +60,7 @@ private IConfigurationRoot GetConfigurationRoot(IEnumerable<string> configuratio
6260
{
6361
ConfigurationBuilder.AddJsonFile(configurationFile);
6462
}
63+
ConfigurationBuilder.AddEnvironmentVariables();
6564
return ConfigurationBuilder.Build();
6665
}
6766

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
3-
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
5-
<LangVersion>latest</LangVersion>
6-
<Nullable>enable</Nullable>
7-
<ImplicitUsings>enable</ImplicitUsings>
8-
</PropertyGroup>
9-
10-
<ItemGroup>
11-
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
12-
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
13-
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
14-
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0" />
15-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
16-
<PackageReference Include="xunit.core" Version="2.4.1" />
17-
</ItemGroup>
18-
<ItemGroup>
19-
<Folder Include="Abstracts\" />
20-
<Folder Include="TestsOrder\" />
21-
<Folder Include="Attributes\" />
22-
</ItemGroup>
23-
</Project>
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>net6.0</TargetFramework>
4+
<LangVersion>latest</LangVersion>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
<ItemGroup>
9+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0"/>
10+
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0"/>
11+
<PackageReference Include="xunit.abstractions" Version="2.0.3"/>
12+
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0"/>
13+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0"/>
14+
<PackageReference Include="xunit.core" Version="2.4.1"/>
15+
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.0"/>
16+
</ItemGroup>
17+
<ItemGroup>
18+
<Folder Include="Abstracts\"/>
19+
<Folder Include="TestsOrder\"/>
20+
<Folder Include="Attributes\"/>
21+
</ItemGroup>
22+
</Project>

src/package.nuspec

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
2-
<package >
3-
<metadata>
4-
<id>Xunit.Microsoft.DependencyInjection</id>
5-
<title>Microsoft Dependency Injection utility for Xunit</title>
6-
<version>1.0</version>
7-
<authors>Arash Sabet</authors>
8-
<owners>Umplify Technologies Inc.</owners>
9-
<licenseUrl>https://github.com/Umplify/xunit-dependency-injection/blob/main/LICENSE</licenseUrl>
10-
<projectUrl>https://umplify.github.io/xunit-dependency-injection/</projectUrl>
11-
<iconUrl>http://umplify.com/wp-content/uploads/2017/11/umplify_logo.png</iconUrl>
12-
<requireLicenseAcceptance>true</requireLicenseAcceptance>
13-
<description>This package contains the necessary classes and features to leverage Xunit's fixture class for Microsoft dependency inection framework.</description>
14-
<copyright>2021 - All rights reserved, Umplify Technologies Inc</copyright>
15-
<tags>xunit dependency-injection microsoft-dependency-injection</tags>
16-
</metadata>
17-
</package>
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<package >
3+
<metadata>
4+
<id>Xunit.Microsoft.DependencyInjection</id>
5+
<title>Microsoft Dependency Injection utility for Xunit</title>
6+
<version>1.0</version>
7+
<authors>Arash Sabet</authors>
8+
<owners>Umplify Technologies Inc.</owners>
9+
<licenseUrl>https://github.com/Umplify/xunit-dependency-injection/blob/main/LICENSE</licenseUrl>
10+
<projectUrl>https://umplify.github.io/xunit-dependency-injection/</projectUrl>
11+
<iconUrl>http://umplify.com/wp-content/uploads/2017/11/umplify_logo.png</iconUrl>
12+
<requireLicenseAcceptance>true</requireLicenseAcceptance>
13+
<description>This package contains the necessary classes and features to leverage Xunit's fixture class for Microsoft dependency inection framework.</description>
14+
<copyright>2022 - All rights reserved, Umplify Technologies Inc.</copyright>
15+
<tags>xunit dependency-injection microsoft-dependency-injection< xunit-dependency-injection</tags>
16+
</metadata>
17+
</package>

0 commit comments

Comments
 (0)