Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NUnit templates #93

Merged
merged 9 commits into from
Sep 21, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "Aleksei Kharlov aka halex2005 (codeofclimber.ru)",
"classifications": [ "Test", "NUnit" ],
"name": "NUnit 3 Test Item",
"defaultName": "NUnitTestItem",
"generatorVersions": "[1.0.0.0-*)",
"description": "A item that contains NUnit tests",
"groupIdentity": "Microsoft.Test.NUnit.ItemTemplate",
"identity": "Microsoft.Test.NUnit.ItemTemplate.CSharp",
"shortName": "nunit-test",
"tags": {
"language": "C#",
"type": "item"
},
"sourceName": "UnitTest1",
"preferNameDirectory": true,
"primaryOutputs": [
{ "path": "UnitTest1.cs" }
],
"postActions": [
{
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
"description": "Opens created test fixture class in the editor",
"manualInstructions": [ ],
"actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6",
"args": {
"files": "0"
},
"continueOnError": true
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using NUnit.Framework;

namespace Tests
{
public class UnitTest1
{
[SetUp]
public void Setup()
{
}

[Test]
public void Test1()
{
Assert.Pass();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "http://json.schemastore.org/dotnetcli.host",
"symbolInfo": {
"TargetFrameworkOverride": {
"isHidden": "true",
"longName": "target-framework-override",
"shortName": ""
},
"Framework": {
"longName": "framework"
},
"EnablePack": {
"shortName": "p",
"longName": "enable-pack"
},
"skipRestore": {
"longName": "no-restore",
"shortName": ""
}
},
"usageExamples": [
""
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "Aleksei Kharlov aka halex2005 (codeofclimber.ru)",
"classifications": [ "Test", "NUnit" ],
"name": "NUnit 3 Test Project",
"defaultName": "NUnitTestProject",
"generatorVersions": "[1.0.0.0-*)",
"description": "A project that contains NUnit tests that can run on .NET Core on Windows, Linux and macOS",
"groupIdentity": "Microsoft.Test.NUnit",
"precedence": "3000",
"identity": "Microsoft.Test.NUnit.CSharp.2.1",
"shortName": "nunit",
"tags": {
"language": "C#",
"type": "project"
},
"sourceName": "Company.TestProject1",
"preferNameDirectory": true,
"symbols": {
"TargetFrameworkOverride": {
"type": "parameter",
"description": "Overrides the target framework",
"replaces": "TargetFrameworkOverride",
"datatype": "string",
"defaultValue": ""
},
"Framework": {
"type": "parameter",
"description": "The target framework for the project.",
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp2.1",
"description": "Target netcoreapp2.1"
}
],
"replaces": "netcoreapp2.1",
"defaultValue": "netcoreapp2.1"
},
"EnablePack": {
"type": "parameter",
"datatype": "bool",
"defaultValue": "false",
"description": "Whether or not to enable packaging (via (\"dotnet pack\") for the project."
},
"HostIdentifier": {
"type": "bind",
"binding": "HostIdentifier"
},
"skipRestore": {
"type": "parameter",
"datatype": "bool",
"description": "If specified, skips the automatic restore of the project on create.",
"defaultValue": "false"
}
},
"primaryOutputs": [
{ "path": "Company.TestProject1.csproj" },
{
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
"path": "UnitTest1.cs"
}
],
"defaultName": "TestProject1",
"postActions": [
{
"condition": "(!skipRestore)",
"description": "Restore NuGet packages required by this project.",
"manualInstructions": [
{ "text": "Run 'dotnet restore'" }
],
"actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025",
"continueOnError": true
},
{
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
"description": "Opens UnitTest1.cs in the editor",
"manualInstructions": [ ],
"actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6",
"args": {
"files": "1"
},
"continueOnError": true
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework Condition="'$(TargetFrameworkOverride)' == ''">netcoreapp2.1</TargetFramework>
<TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">TargetFrameworkOverride</TargetFramework>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.TestProject1</RootNamespace>

<IsPackable Condition="'$(EnablePack)' == 'true'">true</IsPackable>
<IsPackable Condition="'$(EnablePack)' != 'true'">false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="coverlet.collector" Version="1.3.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using NUnit.Framework;

namespace Company.TestProject1
{
public class Tests
{
[SetUp]
public void Setup()
{
}

[Test]
public void Test1()
{
Assert.Pass();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "Aleksei Kharlov aka halex2005 (codeofclimber.ru)",
"classifications": [ "Test", "NUnit" ],
"name": "NUnit 3 Test Item",
"defaultName": "NUnitTestItem",
"generatorVersions": "[1.0.0.0-*)",
"description": "A item that contains NUnit tests",
"groupIdentity": "Microsoft.Test.NUnit.ItemTemplate",
"identity": "Microsoft.Test.NUnit.ItemTemplate.FSharp",
"shortName": "nunit-test",
"tags": {
"language": "F#",
"type": "item"
},
"sourceName": "UnitTest1",
"preferNameDirectory": true,
"primaryOutputs": [
{ "path": "UnitTest1.fs" }
],
"postActions": [
{
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
"description": "Opens created test fixture class in the editor",
"manualInstructions": [ ],
"actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6",
"args": {
"files": "0"
},
"continueOnError": true
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Tests

open NUnit.Framework

[<SetUp>]
let Setup () =
()

[<Test>]
let Test1 () =
Assert.Pass()
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"$schema": "http://json.schemastore.org/dotnetcli.host",
"symbolInfo": {
"TargetFrameworkOverride": {
"isHidden": "true",
"longName": "target-framework-override",
"shortName": ""
},
"Framework": {
"longName": "framework"
},
"EnablePack": {
"shortName": "p",
"longName": "enable-pack"
},
"skipRestore": {
"longName": "no-restore",
"shortName": ""
}
},
"usageExamples": [
""
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "Aleksei Kharlov aka halex2005 (codeofclimber.ru)",
"classifications": [ "Test", "NUnit" ],
"name": "NUnit 3 Test Project",
"defaultName": "NUnitTestProject",
"generatorVersions": "[1.0.0.0-*)",
"description": "A project that contains NUnit tests that can run on .NET Core on Windows, Linux and macOS",
"groupIdentity": "Microsoft.Test.NUnit",
"precedence": "3000",
"identity": "Microsoft.Test.NUnit.FSharp.2.1",
"shortName": "nunit",
"tags": {
"language": "F#",
"type": "project"
},
"sourceName": "Company.TestProject1",
"preferNameDirectory": true,
"symbols": {
"TargetFrameworkOverride": {
"type": "parameter",
"description": "Overrides the target framework",
"replaces": "TargetFrameworkOverride",
"datatype": "string",
"defaultValue": ""
},
"Framework": {
"type": "parameter",
"description": "The target framework for the project.",
"datatype": "choice",
"choices": [
{
"choice": "netcoreapp2.1",
"description": "Target netcoreapp2.1"
}
],
"replaces": "netcoreapp2.1",
"defaultValue": "netcoreapp2.1"
},
"EnablePack": {
"type": "parameter",
"datatype": "bool",
"defaultValue": "false",
"description": "Whether or not to enable packaging (via (\"dotnet pack\") for the project."
},
"HostIdentifier": {
"type": "bind",
"binding": "HostIdentifier"
},
"skipRestore": {
"type": "parameter",
"datatype": "bool",
"description": "If specified, skips the automatic restore of the project on create.",
"defaultValue": "false"
}
},
"primaryOutputs": [
{ "path": "Company.TestProject1.fsproj" },
{
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
"path": "UnitTest1.fs"
}
],
"defaultName": "TestProject1",
"postActions": [
{
"condition": "(!skipRestore)",
"description": "Restore NuGet packages required by this project.",
"manualInstructions": [
{ "text": "Run 'dotnet restore'" }
],
"actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025",
"continueOnError": true
},
{
"condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")",
"description": "Opens UnitTest1.fs in the editor",
"manualInstructions": [ ],
"actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6",
"args": {
"files": "1"
},
"continueOnError": true
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework Condition="'$(TargetFrameworkOverride)' == ''">netcoreapp2.1</TargetFramework>
<TargetFramework Condition="'$(TargetFrameworkOverride)' != ''">TargetFrameworkOverride</TargetFramework>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Company.TestProject1</RootNamespace>

<IsPackable Condition="'$(EnablePack)' == 'true'">true</IsPackable>
<IsPackable Condition="'$(EnablePack)' != 'true'">false</IsPackable>
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>

<ItemGroup>
<Compile Include="UnitTest1.fs"/>
<Compile Include="Program.fs"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
<PackageReference Include="coverlet.collector" Version="1.3.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Program =

[<EntryPoint>]
let main _ = 0