Skip to content

Commit

Permalink
Initialize and install MyTested.AspNetCore.Mvc library
Browse files Browse the repository at this point in the history
-- Install nuget package and add initial configuration settings
#15
  • Loading branch information
stanislavstoyanov99 committed Dec 31, 2020
1 parent 72c0b22 commit 1901d93
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/CookingHub.sln
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CookingHub.Models.ViewModel
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CookingHub.Common", "CookingHub.Common\CookingHub.Common.csproj", "{845F12E8-D494-42A8-900B-AB6C9289C885}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CookingHub.Models.InputModels", "Models\CookingHub.Models.InputModels\CookingHub.Models.InputModels.csproj", "{6D75DCCE-84D9-49ED-9306-F07E73C84B08}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CookingHub.Models.InputModels", "Models\CookingHub.Models.InputModels\CookingHub.Models.InputModels.csproj", "{6D75DCCE-84D9-49ED-9306-F07E73C84B08}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CookingHub.Web.Tests", "Tests\CookingHub.Web.Tests\CookingHub.Web.Tests.csproj", "{81332484-09EF-403C-BDA6-2CC96CB34F8D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -91,6 +93,10 @@ Global
{6D75DCCE-84D9-49ED-9306-F07E73C84B08}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6D75DCCE-84D9-49ED-9306-F07E73C84B08}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6D75DCCE-84D9-49ED-9306-F07E73C84B08}.Release|Any CPU.Build.0 = Release|Any CPU
{81332484-09EF-403C-BDA6-2CC96CB34F8D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{81332484-09EF-403C-BDA6-2CC96CB34F8D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{81332484-09EF-403C-BDA6-2CC96CB34F8D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{81332484-09EF-403C-BDA6-2CC96CB34F8D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -107,6 +113,7 @@ Global
{1932C647-08B4-4DB3-84CC-0433D71278C5} = {7FC7508A-08E6-4B76-9B03-470216F0A3B4}
{8647DA8B-4273-499A-8F83-8E5D5F9BE8CD} = {7FC7508A-08E6-4B76-9B03-470216F0A3B4}
{6D75DCCE-84D9-49ED-9306-F07E73C84B08} = {7FC7508A-08E6-4B76-9B03-470216F0A3B4}
{81332484-09EF-403C-BDA6-2CC96CB34F8D} = {7A731632-6714-44E2-A9E4-069EBA9E666C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {384484BE-4680-4529-9CC2-AD37BA4D12D1}
Expand Down
12 changes: 12 additions & 0 deletions src/Tests/CookingHub.Web.Tests/Controllers/HomeControllerTests.cs
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 src/Tests/CookingHub.Web.Tests/CookingHub.Web.Tests.csproj
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>
22 changes: 22 additions & 0 deletions src/Tests/CookingHub.Web.Tests/TestStartup.cs
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>();
}
}
}

0 comments on commit 1901d93

Please sign in to comment.