Skip to content

Commit c5213d5

Browse files
committed
initial commit
0 parents  commit c5213d5

8 files changed

Lines changed: 205 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: .NET
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v3
18+
with:
19+
dotnet-version: 9.0.x
20+
21+
- name: Restore dependencies
22+
run: dotnet restore
23+
24+
- name: Build
25+
run: dotnet build --no-restore
26+
27+
- name: Test
28+
run: dotnet test --no-build --verbosity normal

.gitignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# User-specific files
5+
*.suo
6+
*.user
7+
*.userosscache
8+
*.sln.docstates
9+
10+
# Build results
11+
[Dd]ebug/
12+
[Dd]ebugPublic/
13+
[Rr]elease/
14+
[Rr]eleases/
15+
x64/
16+
x86/
17+
build/
18+
bld/
19+
[Bb]in/
20+
[Oo]bj/
21+
22+
# Visual Studio cache/options directory
23+
.vs/
24+
25+
# MSTest test Results
26+
[Tt]est[Rr]esult*/
27+
[Bb]uild[Ll]og.*
28+
29+
# NUNIT
30+
*.VisualState.xml
31+
TestResult.xml
32+
33+
# Build Results of an ATL Project
34+
[Dd]ebugPS/
35+
[Rr]eleasePS/
36+
dlldata.c
37+
38+
*_i.c
39+
*_p.c
40+
*_i.h
41+
*.ilk
42+
*.meta
43+
*.obj
44+
*.pch
45+
*.pdb
46+
*.pgc
47+
*.pgd
48+
*.rsp
49+
*.sbr
50+
*.tlb
51+
*.tli
52+
*.tlh
53+
*.tmp
54+
*.tmp_proj
55+
*.log
56+
*.vspscc
57+
*.vssscc
58+
.builds
59+
*.pidb
60+
*.svclog
61+
*.scc
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using Xunit;
2+
3+
namespace GitBugActions.Tests;
4+
5+
public class AppMathTests
6+
{
7+
private readonly AppMath _appMath = new();
8+
9+
[Fact]
10+
public void TestSum()
11+
{
12+
Assert.Equal(3, _appMath.Sum(1, 2));
13+
}
14+
15+
[Fact]
16+
public void TestSubtract()
17+
{
18+
Assert.Equal(1, _appMath.Subtract(2, 1));
19+
}
20+
21+
[Fact]
22+
public void TestMultiply()
23+
{
24+
Assert.Equal(4, _appMath.Multiply(2, 2));
25+
}
26+
27+
[Fact]
28+
public void TestSumTwice()
29+
{
30+
Assert.Equal(6, _appMath.SumTwice(2, 2));
31+
}
32+
33+
[Fact]
34+
public void TestSubtractTwice()
35+
{
36+
Assert.Equal(2, _appMath.SubtractTwice(6, 2));
37+
}
38+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
<IsPackable>false</IsPackable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
12+
<PackageReference Include="xunit" Version="2.4.2" />
13+
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" />
14+
<PackageReference Include="coverlet.collector" Version="3.2.0" />
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<ProjectReference Include="..\GitBugActions\GitBugActions.csproj" />
19+
</ItemGroup>
20+
21+
</Project>

GitBugActions.sln

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Microsoft Visual Studio Solution File, Format Version 12.00
2+
# Visual Studio Version 17
3+
VisualStudioVersion = 17.0.31903.59
4+
MinimumVisualStudioVersion = 10.0.40219.1
5+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitBugActions", "GitBugActions\GitBugActions.csproj", "{5F9B7AE5-8F9D-4E8B-B8A1-D9C5B2E8F8A9}"
6+
EndProject
7+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GitBugActions.Tests", "GitBugActions.Tests\GitBugActions.Tests.csproj", "{7F9B7AE5-8F9D-4E8B-B8A1-D9C5B2E8F8A9}"
8+
EndProject
9+
Global
10+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
11+
Debug|Any CPU = Debug|Any CPU
12+
Release|Any CPU = Release|Any CPU
13+
EndGlobalSection
14+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
15+
{5F9B7AE5-8F9D-4E8B-B8A1-D9C5B2E8F8A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
16+
{5F9B7AE5-8F9D-4E8B-B8A1-D9C5B2E8F8A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
17+
{5F9B7AE5-8F9D-4E8B-B8A1-D9C5B2E8F8A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
18+
{5F9B7AE5-8F9D-4E8B-B8A1-D9C5B2E8F8A9}.Release|Any CPU.Build.0 = Release|Any CPU
19+
{7F9B7AE5-8F9D-4E8B-B8A1-D9C5B2E8F8A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20+
{7F9B7AE5-8F9D-4E8B-B8A1-D9C5B2E8F8A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
21+
{7F9B7AE5-8F9D-4E8B-B8A1-D9C5B2E8F8A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
22+
{7F9B7AE5-8F9D-4E8B-B8A1-D9C5B2E8F8A9}.Release|Any CPU.Build.0 = Release|Any CPU
23+
EndGlobalSection
24+
EndGlobal

GitBugActions/AppMath.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
namespace GitBugActions;
2+
3+
public class AppMath
4+
{
5+
public int Sum(int a, int b) => a - b;
6+
7+
public int Subtract(int a, int b) => a - b;
8+
9+
public int Multiply(int a, int b) => a * b;
10+
11+
public int SumTwice(int a, int b) => a + b + b;
12+
13+
public int SubtractTwice(int a, int b) => a - b - b;
14+
}

GitBugActions/GitBugActions.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net9.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
</Project>

GitBugActions/Program.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace GitBugActions;
2+
3+
public class Program
4+
{
5+
public static void Main(string[] args)
6+
{
7+
Console.WriteLine("Hello, World!");
8+
}
9+
}

0 commit comments

Comments
 (0)