Skip to content

Commit 4545ba5

Browse files
Merge pull request #70 from vivopensource/dev
Merges Dev to Main V-1.3.3
2 parents e609075 + 0cdcd20 commit 4545ba5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1367
-109
lines changed

.github/workflows/dotnet-desktop.yml

Lines changed: 0 additions & 91 deletions
This file was deleted.

.github/workflows/pull_request.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
2+
name: Pull Request
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- 'dev'
8+
9+
jobs:
10+
11+
test-linux:
12+
13+
runs-on: ubuntu-latest
14+
15+
env:
16+
Solution_Name: GofPatterns.sln
17+
Test_Project_Path: GofPatternsTests\GofPatternsTests.csproj
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Install .NET Core
26+
uses: actions/setup-dotnet@v3
27+
with:
28+
dotnet-version: 6.0.x
29+
30+
- name: Restore dependencies
31+
run: dotnet restore
32+
33+
- name: Build
34+
run: dotnet build --configuration Debug --no-restore
35+
36+
- name: Test
37+
run: dotnet test --configuration Debug --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
38+
39+
- name: Code Coverage Result MD
40+
uses: irongut/CodeCoverageSummary@v1.3.0
41+
with:
42+
filename: coverage/**/coverage.cobertura.xml
43+
badge: true
44+
fail_below_min: true
45+
format: markdown
46+
hide_branch_rate: false
47+
hide_complexity: true
48+
indicators: true
49+
output: both
50+
thresholds: '80 90'
51+
52+
- name: Code Coverage Result MD
53+
uses: marocchino/sticky-pull-request-comment@v2
54+
with:
55+
recreate: true
56+
path: code-coverage-results.md
57+
58+
- name: Write to Job Summary
59+
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
60+
61+
test-windows:
62+
63+
runs-on: windows-latest
64+
65+
env:
66+
Solution_Name: GofPatterns.sln
67+
Test_Project_Path: GofPatternsTests\GofPatternsTests.csproj
68+
69+
steps:
70+
- name: Checkout
71+
uses: actions/checkout@v3
72+
with:
73+
fetch-depth: 0
74+
75+
- name: Install .NET Core
76+
uses: actions/setup-dotnet@v3
77+
with:
78+
dotnet-version: 6.0.x
79+
80+
- name: Setup MSBuild.exe
81+
uses: microsoft/setup-msbuild@v1.0.2
82+
83+
- name: Restore dependencies
84+
run: dotnet restore
85+
86+
- name: Build
87+
run: dotnet build
88+
89+
- name: Test
90+
run: dotnet test
91+
92+
- name: Restore the application
93+
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
94+
env:
95+
Configuration: Debug

.github/workflows/release.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
2+
name: Release
3+
4+
on:
5+
push:
6+
branches:
7+
- 'main'
8+
9+
jobs:
10+
11+
release:
12+
13+
runs-on: ubuntu-latest
14+
15+
env:
16+
Solution_Name: GofPatterns.sln
17+
Test_Project_Path: GofPatternsTests\GofPatternsTests.csproj
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Install .NET Core
25+
uses: actions/setup-dotnet@v3
26+
with:
27+
dotnet-version: 6.0.x
28+
29+
- name: Restore dependencies
30+
run: dotnet restore
31+
32+
- name: Build
33+
run: dotnet build -c Release --no-restore
34+
35+
- name: Test
36+
run: dotnet test -c Release --no-restore --no-build --verbosity normal --filter "Category!=LongRunning" --collect:"XPlat Code Coverage" --results-directory ./coverage
37+
38+
- name: Code Coverage Report
39+
uses: irongut/CodeCoverageSummary@v1.3.0
40+
with:
41+
filename: coverage/**/coverage.cobertura.xml
42+
badge: true
43+
fail_below_min: true
44+
format: markdown
45+
hide_branch_rate: false
46+
hide_complexity: true
47+
indicators: true
48+
output: both
49+
thresholds: '80 90'
50+
51+
- name: Code Coverage Result MD
52+
uses: marocchino/sticky-pull-request-comment@v2
53+
with:
54+
recreate: true
55+
path: code-coverage-results.md
56+
57+
- name: Write to Job Summary
58+
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
59+
60+
- name: Pack
61+
run: dotnet pack GofPatterns/GofPatterns.csproj -c Release --no-restore --no-build --include-symbols -p:SymbolPackageFormat=snupkg -o .
62+
63+
# Push to NuGet
64+
- name: Deploy
65+
run: dotnet nuget push *.nupkg --skip-duplicate -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}}

.github/workflows/test.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
2+
name: Test
3+
4+
on:
5+
push:
6+
branches:
7+
- '**'
8+
- '!main'
9+
- '!dev'
10+
11+
jobs:
12+
13+
test:
14+
15+
runs-on: ubuntu-latest
16+
17+
env:
18+
Solution_Name: GofPatterns.sln
19+
Test_Project_Path: GofPatternsTests\GofPatternsTests.csproj
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v3
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Install .NET Core
28+
uses: actions/setup-dotnet@v3
29+
with:
30+
dotnet-version: 6.0.x
31+
32+
- name: Restore dependencies
33+
run: dotnet restore
34+
35+
- name: Build
36+
run: dotnet build --configuration Debug --no-restore
37+
38+
- name: Test
39+
run: dotnet test --configuration Debug --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage
40+
41+
- name: Code Coverage Result MD
42+
uses: irongut/CodeCoverageSummary@v1.3.0
43+
with:
44+
filename: coverage/**/coverage.cobertura.xml
45+
badge: true
46+
fail_below_min: true
47+
format: markdown
48+
hide_branch_rate: false
49+
hide_complexity: true
50+
indicators: true
51+
output: both
52+
thresholds: '80 90'
53+
54+
- name: Code Coverage Result MD
55+
uses: marocchino/sticky-pull-request-comment@v2
56+
with:
57+
recreate: true
58+
path: code-coverage-results.md
59+
60+
- name: Write to Job Summary
61+
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY

GofConsoleApp/Examples/ExecutionHelpers/PatternOptions.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using GofConsoleApp.Examples.Creational.BuilderPattern;
99
using GofConsoleApp.Examples.Creational.FactoryPattern;
1010
using GofConsoleApp.Examples.Structural.AdapterPattern;
11+
using GofConsoleApp.Examples.Structural.BridgePattern;
1112
using GofConsoleApp.Examples.Structural.DecoratorPattern;
1213
using GofConsoleApp.Examples.Structural.FlyweightPattern;
1314
using GofConsoleApp.Examples.Structural.ProxyPattern;
@@ -37,6 +38,9 @@ internal static class PatternOptions
3738
internal const string StatePatternOptionDriveExample = "23.2";
3839
internal const string StrategyPatternOptionSender = "24";
3940
internal const string StrategyPatternOptionPayment = "24.2";
41+
internal const string BridgePatterOptionSingleImplementations = "25";
42+
internal const string BridgePatterOptionMultipleImplementations = "25.2";
43+
internal const string BridgePatterOptionMarker = "25.3";
4044

4145
internal const string FactoryOption = "31";
4246
internal const string AbstractFactoryOption = "32";
@@ -84,7 +88,8 @@ internal static class PatternOptions
8488
},
8589
{
8690
ObserverPatternOptionWithType,
87-
new PatternExampleMap("Observer Pattern >> News Publisher with type", new ObserverPatternExampleWithCategory())
91+
new PatternExampleMap("Observer Pattern >> News Publisher with type",
92+
new ObserverPatternExampleWithCategory())
8893
},
8994

9095
// Behavioral Patterns
@@ -127,6 +132,20 @@ internal static class PatternOptions
127132
StrategyPatternOptionPayment,
128133
new PatternExampleMap("Strategy Pattern >> Payment Example", new StrategyPatternPaymentExample())
129134
},
135+
{
136+
BridgePatterOptionSingleImplementations,
137+
new PatternExampleMap("Bridge Pattern >> With Single Implementation",
138+
new BridgePatternExampleSingleImplementations())
139+
},
140+
{
141+
BridgePatterOptionMultipleImplementations,
142+
new PatternExampleMap("Bridge Pattern >> With Multiple Implementations",
143+
new BridgePatternExampleMultipleImplementations())
144+
},
145+
{
146+
BridgePatterOptionMarker,
147+
new PatternExampleMap("Bridge Pattern >> With Marker", new BridgePatternExampleWithMarker())
148+
},
130149

131150
// Creational Patterns
132151
{

GofConsoleApp/Examples/Structural/AdapterPattern/Adaptee/Employee.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ public Employee(string id, string firstName, string lastName, string address)
1111
}
1212

1313
public string Id { get; }
14+
1415
public string FirstName { get; }
16+
1517
public string LastName { get; }
18+
1619
public string Address { get; }
1720
}

GofConsoleApp/Examples/Structural/AdapterPattern/Adaptee/IEmployee.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
internal interface IEmployee
77
{
88
string Id { get; }
9+
910
string FirstName { get; }
11+
1012
string LastName { get; }
13+
1114
string Address { get; }
1215
}

0 commit comments

Comments
 (0)