Skip to content

Commit b2a922a

Browse files
committed
Revert changes t v2
1 parent c3fd24a commit b2a922a

File tree

6 files changed

+21
-62
lines changed

6 files changed

+21
-62
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,6 @@ jobs:
206206
dotnet restore ${{ github.workspace }}/TemplateTestMstest --source https://api.nuget.org/v3/index.json --source ${{ env.NUGET_DIRECTORY }}
207207
dotnet test ${{ github.workspace }}/TemplateTestMstest
208208
209-
- name: ✔ Verify TUnit template
210-
run: |
211-
dotnet new bunit --framework tunit --no-restore -o ${{ github.workspace }}/TemplateTestTUnit
212-
echo '<?xml version="1.0" encoding="utf-8"?><Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"></Project>' >> ${{ github.workspace }}/TemplateTestTUnit/Directory.Build.props
213-
echo '<Project><PropertyGroup><ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally></PropertyGroup></Project>' >> ${{ github.workspace }}/TemplateTestTUnit/Directory.Packages.props
214-
dotnet restore ${{ github.workspace }}/TemplateTestTUnit --source https://api.nuget.org/v3/index.json --source ${{ env.NUGET_DIRECTORY }}
215-
dotnet test ${{ github.workspace }}/TemplateTestTUnit
216-
217209
validate-docs:
218210
runs-on: ubuntu-latest
219211
steps:

src/bunit.template/bunit.template.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,4 @@
4141
<None Remove="template\CounterRazorTests.razor" />
4242
</ItemGroup>
4343

44-
<ItemGroup>
45-
<Folder Include="temp\" />
46-
</ItemGroup>
47-
4844
</Project>

src/bunit.template/template/.template.config/dotnetcli.host.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"--framework xunit --sdk net8.0",
1818
"--framework xunitv3 --sdk net8.0",
1919
"--framework nunit --sdk net8.0",
20-
"--framework mstest --sdk net8.0",
21-
"--framework tunit --sdk net8.0"
20+
"--framework mstest --sdk net8.0"
2221
]
2322
}

src/bunit.template/template/.template.config/template.json

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
{
2424
"modifiers": [
2525
{
26-
"exclude": [ "_Imports.razor", "CounterRazorTests.razor" ],
27-
"condition": "(testFramework_tunit)"
26+
"exclude": [ "BunitTestContext.cs" ],
27+
"condition": "(testFramework_xunit || testFramework_xunitv3)"
2828
}
2929
]
3030
}
@@ -67,11 +67,6 @@
6767
"choice": "mstest",
6868
"description": "MSTest unit testing framework",
6969
"displayName": "MSTest"
70-
},
71-
{
72-
"choice": "tunit",
73-
"description": "TUnit unit testing framework",
74-
"displayName": "TUnit"
7570
}
7671
]
7772
},
@@ -91,10 +86,6 @@
9186
"type": "computed",
9287
"value": "UnitTestFramework == \"mstest\""
9388
},
94-
"testFramework_tunit": {
95-
"type": "computed",
96-
"value": "UnitTestFramework == \"tunit\""
97-
},
9889
"targetSdk": {
9990
"type": "parameter",
10091
"description": "The target framework sdk for the project.",

src/bunit.template/template/Company.BlazorTests1.csproj

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
<!--#if (testFramework_tunit) -->
2-
<Project Sdk="Microsoft.NET.Sdk">
3-
<!--#else -->
41
<Project Sdk="Microsoft.NET.Sdk.Razor">
5-
<!--#endif -->
2+
63
<PropertyGroup>
74
<TargetFramework>targetSdk</TargetFramework>
85
<Nullable>enable</Nullable>
96
<IsPackable>false</IsPackable>
10-
<OutputType Condition="'$(testFramework_tunit)' == 'true'">Exe</OutputType>
117
</PropertyGroup>
128

139
<ItemGroup>
@@ -22,8 +18,8 @@
2218

2319
<ItemGroup>
2420
<PackageReference Include="bunit" Version="#{RELEASE_VERSION}#" />
25-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" Condition="'$(testFramework_tunit)' != 'true'"/>
26-
<PackageReference Include="coverlet.collector" Version="6.0.3" Condition="'$(testFramework_tunit)' != 'true'">
21+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
22+
<PackageReference Include="coverlet.collector" Version="6.0.3">
2723
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2824
<PrivateAssets>all</PrivateAssets>
2925
</PackageReference>
@@ -55,8 +51,4 @@
5551
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
5652
</ItemGroup>
5753

58-
<ItemGroup Condition="'$(testFramework_tunit)' == 'true'">
59-
<PackageReference Include="TUnit" Version="0.6.154" />
60-
</ItemGroup>
61-
6254
</Project>
Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
#if (testFramework_tunit)
2-
using TUnit.Core;
3-
#endif
4-
51
namespace Company.BlazorTests1;
62

73
/// <summary>
@@ -18,8 +14,6 @@ public class CounterCSharpTest : BunitContext
1814
#elif (testFramework_mstest)
1915
[TestClass]
2016
public class CounterCSharpTest : BunitContext
21-
#elif (testFramework_tunit)
22-
public class CounterCSharpTest : BunitContext
2317
#endif
2418
{
2519
#if (testFramework_xunit)
@@ -30,18 +24,15 @@ public class CounterCSharpTest : BunitContext
3024
[Test]
3125
#elif (testFramework_mstest)
3226
[TestMethod]
33-
#elif (testFramework_tunit)
34-
[Test]
3527
#endif
36-
3728
public void CounterStartsAtZero()
38-
{
39-
// Arrange
40-
var cut = Render<Counter>();
29+
{
30+
// Arrange
31+
var cut = Render<Counter>();
4132

42-
// Assert that content of the paragraph shows counter at zero
43-
cut.Find("p").MarkupMatches("<p>Current count: 0</p>");
44-
}
33+
// Assert that content of the paragraph shows counter at zero
34+
cut.Find("p").MarkupMatches("<p>Current count: 0</p>");
35+
}
4536

4637
#if (testFramework_xunit)
4738
[Fact]
@@ -51,18 +42,16 @@ public void CounterStartsAtZero()
5142
[Test]
5243
#elif (testFramework_mstest)
5344
[TestMethod]
54-
#elif (testFramework_tunit)
55-
[Test]
5645
#endif
57-
public void ClickingButtonIncrementsCounter()
58-
{
59-
// Arrange
60-
var cut = Render<Counter>();
46+
public void ClickingButtonIncrementsCounter()
47+
{
48+
// Arrange
49+
var cut = Render<Counter>();
6150

62-
// Act - click button to increment counter
63-
cut.Find("button").Click();
51+
// Act - click button to increment counter
52+
cut.Find("button").Click();
6453

65-
// Assert that the counter was incremented
66-
cut.Find("p").MarkupMatches("<p>Current count: 1</p>");
67-
}
54+
// Assert that the counter was incremented
55+
cut.Find("p").MarkupMatches("<p>Current count: 1</p>");
56+
}
6857
}

0 commit comments

Comments
 (0)