Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
vangj committed Apr 21, 2023
1 parent 1dd0da2 commit c4153b9
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 0 deletions.
29 changes: 29 additions & 0 deletions dummy-lib/Hero.Test/Hero.Test.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.2.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Hero\Hero.csproj" />
</ItemGroup>

</Project>
15 changes: 15 additions & 0 deletions dummy-lib/Hero.Test/Service.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Hero.Service;

namespace Hero.UnitTests.Service
{
public class ServiceTest
{
[Fact]
public void GetAction()
{
var carService = new CarService();
string action = carService.GetAction("red");
Assert.Equal("stop", action);
}
}
}
1 change: 1 addition & 0 deletions dummy-lib/Hero.Test/Usings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using Xunit;
9 changes: 9 additions & 0 deletions dummy-lib/Hero/Hero.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
25 changes: 25 additions & 0 deletions dummy-lib/Hero/Service.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace Hero.Service
{
public class CarService
{
public string GetAction(string light)
{
if (light.ToLower().Equals("red"))
{
return "stop";
}

if (light.ToLower().Equals("yellow"))
{
return "slow";
}

if (light.ToLower().Equals("green"))
{
return "go";
}

return "i don't know";
}
}
}
28 changes: 28 additions & 0 deletions dummy-lib/dummy-lib.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hero", "Hero\Hero.csproj", "{9AC4ACB3-0414-4FEE-B168-F71FFCACA42E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hero.Test", "Hero.Test\Hero.Test.csproj", "{96718081-467A-4CBA-A8FD-73171DE235B7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9AC4ACB3-0414-4FEE-B168-F71FFCACA42E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9AC4ACB3-0414-4FEE-B168-F71FFCACA42E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9AC4ACB3-0414-4FEE-B168-F71FFCACA42E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9AC4ACB3-0414-4FEE-B168-F71FFCACA42E}.Release|Any CPU.Build.0 = Release|Any CPU
{96718081-467A-4CBA-A8FD-73171DE235B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{96718081-467A-4CBA-A8FD-73171DE235B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{96718081-467A-4CBA-A8FD-73171DE235B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{96718081-467A-4CBA-A8FD-73171DE235B7}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

0 comments on commit c4153b9

Please sign in to comment.