-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initialize and install MyTested.AspNetCore.Mvc library
-- Install nuget package and add initial configuration settings #15
- Loading branch information
1 parent
72c0b22
commit 1901d93
Showing
4 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/Tests/CookingHub.Web.Tests/Controllers/HomeControllerTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace CookingHub.Web.Tests.Controllers | ||
{ | ||
using CookingHub.Web.Controllers; | ||
|
||
using MyTested.AspNetCore.Mvc; | ||
using Xunit; | ||
|
||
public class HomeControllerTests | ||
{ | ||
|
||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/Tests/CookingHub.Web.Tests/CookingHub.Web.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
|
||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" /> | ||
<PackageReference Include="MyTested.AspNetCore.Mvc.Universe" Version="3.1.2" /> | ||
<PackageReference Include="xunit" Version="2.4.1" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
<PrivateAssets>all</PrivateAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\Web\CookingHub.Web\CookingHub.Web.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace CookingHub.Web.Tests | ||
{ | ||
using Microsoft.Extensions.Configuration; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
// TODO: add configuration for custom services | ||
public class TestStartup : Startup | ||
{ | ||
public TestStartup(IConfiguration configuration) : base(configuration) | ||
{ | ||
} | ||
|
||
public void ConfigureTestServices(IServiceCollection services) | ||
{ | ||
base.ConfigureServices(services); | ||
|
||
// Replace only your own custom services. The ASP.NET Core ones | ||
// are already replaced by MyTested.AspNetCore.Mvc. | ||
// services.Replace<IService, MockedService>(); | ||
} | ||
} | ||
} |