Skip to content

Commit 244e172

Browse files
committed
small fixes in C# solution
1 parent b4bd87b commit 244e172

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

exercise/c#/Day11/Day11/RomanNumerals.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static class RomanNumerals
2727

2828
public static Option<string> ToRoman(this int number) => Convert(number);
2929

30-
public static Option<string> Convert(int number)
30+
private static Option<string> Convert(int number)
3131
=> IsInRange(number)
3232
? ConvertSafely(number)
3333
: None;

solution/c#/Day03/Day03.Tests/PopulationTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using FluentAssertions;
22
using Xunit;
3+
using static System.Int32;
34
using static Day03.PetType;
45

56
namespace Day03.Tests
@@ -28,6 +29,9 @@ public void Who_Owns_The_Youngest_Pet()
2829
}
2930

3031
private static int YoungestPetAgeOfThePerson(Person person) =>
31-
person.Pets.MinBy(p => p.Age)?.Age ?? int.MaxValue;
32+
person
33+
.Pets
34+
.MinBy(p => p.Age)?
35+
.Age ?? MaxValue;
3236
}
3337
}

solution/c#/Day07/Day07/CI/Functional/Pipeline.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ public class Pipeline(IConfig config, IEmailer emailer, ILogger log)
77
{
88
private const string Success = "success";
99

10-
public void Run(Project project)
10+
public Option<PipelineContext> Run(Project project)
1111
=> ContextFor(project)
1212
.Bind(RunTests)
1313
.Bind(Deploy);
@@ -77,7 +77,7 @@ private void SendEmail(String text)
7777
emailer.Send(text);
7878
}
7979

80-
private sealed class PipelineContext(Project project)
80+
public sealed class PipelineContext(Project project)
8181
{
8282
public bool MustRunDeployment() => TestsRanSuccessfully || !HasTests;
8383

solution/c#/Day07/Day07/CI/Pipeline.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public void Run(Project project)
1414
return;
1515
}
1616

17-
if (DunDeploymentFailed(project))
17+
if (RunDeploymentFailed(project))
1818
{
1919
SendEmail("Deployment failed");
2020
return;
@@ -41,7 +41,7 @@ private bool RunTestsFailed(Project project)
4141
return false;
4242
}
4343

44-
private bool DunDeploymentFailed(Project project)
44+
private bool RunDeploymentFailed(Project project)
4545
{
4646
if (project.Deploy() == Success)
4747
{

solution/c#/Day11/Day11/RomanNumerals.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static class RomanNumerals
2727

2828
public static Option<string> ToRoman(this int number) => Convert(number);
2929

30-
public static Option<string> Convert(int number)
30+
private static Option<string> Convert(int number)
3131
=> IsInRange(number)
3232
? ConvertSafely(number)
3333
: None;

0 commit comments

Comments
 (0)