Skip to content

Commit

Permalink
Merge pull request #8 from seangwright/master
Browse files Browse the repository at this point in the history
Feature: Project restructuring for unit tests
  • Loading branch information
kentico-ericd authored May 23, 2022
2 parents 335bede + a9832ff commit 2bcbac4
Show file tree
Hide file tree
Showing 15 changed files with 181 additions and 9 deletions.
11 changes: 11 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"recommendations": [
"ms-dotnettools.csharp",
"jchannon.csharpextensions",
"k--kato.docomment",
"editorconfig.editorconfig",
"davidanson.vscode-markdownlint",
"bierner.markdown-preview-github-styles",
"formulahendry.dotnet-test-explorer"
]
}
27 changes: 27 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"version": "0.2.0",
"configurations": [
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/tests/Xperience.Core.Breadcrumbs.Tests/bin/Debug/net6.0/Xperience.Core.Breadcrumbs.Tests.dll",
"args": [],
"cwd": "${workspaceFolder}/tests/Xperience.Core.Breadcrumbs.Tests.Tests",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
39 changes: 39 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true
},

"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/*.code-search": true,
"**/bin": true,
"**/obj": true
},

"editor.formatOnSave": true,

"[csharp]": {
"editor.semanticHighlighting.enabled": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
}
},

"[razor]": {
"editor.semanticHighlighting.enabled": true,
"editor.defaultFormatter": "ms-dotnettools.csharp"
},

"omnisharp.defaultLaunchSolution": "./XperienceCoreBreadcrumbs.sln",
"omnisharp.organizeImportsOnFormat": true,
"omnisharp.useEditorFormattingSettings": true,
"omnisharp.enableEditorConfigSupport": true,
"omnisharp.enableImportCompletion": true,
"omnisharp.useModernNet": true
}
48 changes: 48 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "shell",
"args": [
"build",
// Ask dotnet build to generate full paths for file names.
"/property:GenerateFullPaths=true",
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
"/consoleloggerparameters:NoSummary"
],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},

{
"label": "restore",
"command": "dotnet",
"type": "shell",
"args": ["restore"],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
},

{
"label": "clean",
"command": "dotnet",
"type": "shell",
"args": ["clean"],
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
}
]
}
21 changes: 15 additions & 6 deletions XperienceCoreBreadcrumbs.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,33 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xperience.Core.Breadcrumbs", "Xperience.Core.Breadcrumbs.csproj", "{B2C8ECFF-6809-4583-BC36-BB0F1BC6EBFC}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{89019A0F-B5BB-4AE6-A4C6-551269F5D487}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xperience.Core.Breadcrumbs.Tests", "tests\Xperience.Core.Breadcrumbs.Tests\Xperience.Core.Breadcrumbs.Tests.csproj", "{FC39051D-0F42-48CC-B648-20C5B324A41F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xperience.Core.Breadcrumbs", "src\Xperience.Core.Breadcrumbs\Xperience.Core.Breadcrumbs.csproj", "{F48F46B0-25FA-4362-801E-82A176458CC6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B2C8ECFF-6809-4583-BC36-BB0F1BC6EBFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2C8ECFF-6809-4583-BC36-BB0F1BC6EBFC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2C8ECFF-6809-4583-BC36-BB0F1BC6EBFC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2C8ECFF-6809-4583-BC36-BB0F1BC6EBFC}.Release|Any CPU.Build.0 = Release|Any CPU
{FC39051D-0F42-48CC-B648-20C5B324A41F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FC39051D-0F42-48CC-B648-20C5B324A41F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC39051D-0F42-48CC-B648-20C5B324A41F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC39051D-0F42-48CC-B648-20C5B324A41F}.Release|Any CPU.Build.0 = Release|Any CPU
{F48F46B0-25FA-4362-801E-82A176458CC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F48F46B0-25FA-4362-801E-82A176458CC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F48F46B0-25FA-4362-801E-82A176458CC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F48F46B0-25FA-4362-801E-82A176458CC6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{B2C8ECFF-6809-4583-BC36-BB0F1BC6EBFC} = {DA5907AB-51CA-4F62-9704-62076FAE976E}
{FC39051D-0F42-48CC-B648-20C5B324A41F} = {89019A0F-B5BB-4AE6-A4C6-551269F5D487}
{F48F46B0-25FA-4362-801E-82A176458CC6} = {DA5907AB-51CA-4F62-9704-62076FAE976E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F39B990D-E00C-4A3A-8354-F87303EA22C1}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@

<PropertyGroup>
<LangVersion>8.0</LangVersion>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Kentico.Xperience.AspNetCore.WebApp" Version="13.0.0" />
<PackageReference Include="Kentico.Xperience.AspNetCore.WebApp" Version="[13.0.0, 13.1.0)" />
<PackageReference Include="Microsoft.AspNetCore.Html.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="2.2.0" />
</ItemGroup>
Expand Down
18 changes: 18 additions & 0 deletions tests/Xperience.Core.Breadcrumbs.Tests/UnitTest1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using NUnit.Framework;

namespace Xperience.Core.Breadcrumbs.Tests
{
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,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="Kentico.Xperience.AspNetCore.WebApp" Version="13.0.70" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Xperience.Core.Breadcrumbs\Xperience.Core.Breadcrumbs.csproj" />
</ItemGroup>

</Project>

0 comments on commit 2bcbac4

Please sign in to comment.