Skip to content

Commit 26feb2a

Browse files
authored
Regression (#137)
chore: Adding Regression Tests
1 parent ef651a7 commit 26feb2a

File tree

3 files changed

+189
-0
lines changed

3 files changed

+189
-0
lines changed

.github/workflows/regression.yml

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: Regression Tests
2+
# https://dotnet.microsoft.com/download/dotnet-core
3+
# https://dotnet.microsoft.com/download/dotnet-framework
4+
5+
on:
6+
[ push ]
7+
8+
jobs:
9+
build:
10+
runs-on: windows-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Cache
16+
id: unity-abstractions
17+
uses: actions/cache@v1
18+
with:
19+
path: '${{ github.workspace }}/package'
20+
key: ${{ github.sha }}
21+
22+
- name: Build Package
23+
env:
24+
PackageVersion: '0.0.0'
25+
PackageOutputPath: '${{ github.workspace }}/package'
26+
run: dotnet msbuild -property:Configuration=Release -verbosity:m -restore:True src
27+
28+
net:
29+
needs: [ Build ]
30+
strategy:
31+
matrix:
32+
framework: ['net48', 'net47', 'net46', 'net45']
33+
runs-on: windows-latest
34+
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v2
38+
39+
- name: Cache
40+
id: unity-abstractions
41+
uses: actions/cache@v1
42+
with:
43+
path: '${{ github.workspace }}/package'
44+
key: ${{ github.sha }}
45+
46+
- name: Build Package
47+
env:
48+
TargetFramework: ${{ matrix.framework }}
49+
run: |
50+
dotnet remove ${{ github.workspace }}/tests/Unity.Abstractions.Tests.csproj reference "..\src\Unity.Abstractions.csproj"
51+
dotnet add ${{ github.workspace }}/tests/Unity.Abstractions.Tests.csproj package --source '${{ github.workspace }}/package' Unity.Abstractions --version 0.0.0
52+
dotnet msbuild -property:Configuration=Release -verbosity:m -restore:True ${{ github.workspace }}/tests/Unity.Abstractions.Tests.csproj
53+
54+
- name: Test
55+
env:
56+
TargetFramework: ${{ matrix.framework }}
57+
run: dotnet test ${{ github.workspace }}/tests/bin/Release/${{ matrix.framework }}/Unity.Abstractions.Tests.dll
58+
59+
60+
core-lts-2:
61+
needs: [ Build ]
62+
strategy:
63+
matrix:
64+
os: [windows-latest, ubuntu-latest]
65+
runs-on: ${{ matrix.os }}
66+
67+
steps:
68+
- name: Checkout
69+
uses: actions/checkout@v2
70+
71+
- name: Install DotNet
72+
uses: actions/setup-dotnet@v1
73+
with:
74+
dotnet-version: '2.1.806'
75+
76+
- name: Install Nuget
77+
uses: nuget/setup-nuget@v1
78+
79+
- name: Cache
80+
id: unity-abstractions
81+
uses: actions/cache@v1
82+
with:
83+
path: '${{ github.workspace }}/package'
84+
key: ${{ github.sha }}
85+
86+
- name: Build Package
87+
env:
88+
TargetFramework: netcoreapp2.1
89+
run: |
90+
nuget add ${{ github.workspace }}/package/Unity.Abstractions.0.0.0.nupkg -Source packages
91+
dotnet remove ${{ github.workspace }}/tests/Unity.Abstractions.Tests.csproj reference "..\src\Unity.Abstractions.csproj"
92+
dotnet add ${{ github.workspace }}/tests/Unity.Abstractions.Tests.csproj package --source packages Unity.Abstractions --version 0.0.0
93+
dotnet msbuild -property:Configuration=Release -verbosity:m -restore:True ${{ github.workspace }}/tests/Unity.Abstractions.Tests.csproj
94+
95+
- name: Test
96+
env:
97+
TargetFramework: netcoreapp2.1
98+
run: dotnet vstest ${{ github.workspace }}/tests/bin/Release/netcoreapp2.1/Unity.Abstractions.Tests.dll
99+
100+
101+
core-lts-3:
102+
needs: [ Build ]
103+
strategy:
104+
matrix:
105+
os: [windows-latest, ubuntu-latest, macos-latest]
106+
runs-on: ${{ matrix.os }}
107+
108+
steps:
109+
- name: Checkout
110+
uses: actions/checkout@v2
111+
112+
- name: Install DotNet
113+
uses: actions/setup-dotnet@v1
114+
with:
115+
dotnet-version: '3.1.202'
116+
117+
- name: Cache
118+
id: unity-abstractions
119+
uses: actions/cache@v1
120+
with:
121+
path: '${{ github.workspace }}/package'
122+
key: ${{ github.sha }}
123+
124+
- name: Build Package
125+
env:
126+
TargetFramework: netcoreapp3.1
127+
run: |
128+
dotnet remove ${{ github.workspace }}/tests/Unity.Abstractions.Tests.csproj reference "..\src\Unity.Abstractions.csproj"
129+
dotnet add ${{ github.workspace }}/tests/Unity.Abstractions.Tests.csproj package --source '${{ github.workspace }}/package' Unity.Abstractions --version 0.0.0
130+
dotnet msbuild -property:Configuration=Release -verbosity:m -restore:True ${{ github.workspace }}/tests/Unity.Abstractions.Tests.csproj
131+
132+
- name: Test
133+
env:
134+
TargetFramework: netcoreapp3.1
135+
run: dotnet test ${{ github.workspace }}/tests/bin/Release/netcoreapp3.1/Unity.Abstractions.Tests.dll

tests/TypeLifetime.cs

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
3+
namespace Unity.Lifetime.Tests
4+
{
5+
[TestClass]
6+
public class TypeLifetime
7+
{
8+
9+
[TestMethod]
10+
public void unitycontainer_container_88()
11+
{
12+
}
13+
14+
[TestMethod]
15+
public void unitycontainer_container_92()
16+
{
17+
}
18+
19+
[TestMethod]
20+
public void unitycontainer_unity_204_1()
21+
{
22+
}
23+
24+
25+
[TestMethod]
26+
public void unitycontainer_unity_204_2()
27+
{
28+
}
29+
30+
31+
[TestMethod]
32+
public void unitycontainer_container_82()
33+
{
34+
}
35+
36+
}
37+
}

tests/Unity.Abstractions.Tests.csproj

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework Condition=" '$(TargetFramework)' == '' ">net48</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
9+
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
10+
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<ProjectReference Include="..\src\Unity.Abstractions.csproj" />
15+
</ItemGroup>
16+
17+
</Project>

0 commit comments

Comments
 (0)