Skip to content

Commit

Permalink
small fixes in C# solution
Browse files Browse the repository at this point in the history
  • Loading branch information
ythirion committed Jan 3, 2024
1 parent b4bd87b commit 244e172
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion exercise/c#/Day11/Day11/RomanNumerals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static class RomanNumerals

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

public static Option<string> Convert(int number)
private static Option<string> Convert(int number)
=> IsInRange(number)
? ConvertSafely(number)
: None;
Expand Down
6 changes: 5 additions & 1 deletion solution/c#/Day03/Day03.Tests/PopulationTests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using FluentAssertions;
using Xunit;
using static System.Int32;
using static Day03.PetType;

namespace Day03.Tests
Expand Down Expand Up @@ -28,6 +29,9 @@ public void Who_Owns_The_Youngest_Pet()
}

private static int YoungestPetAgeOfThePerson(Person person) =>
person.Pets.MinBy(p => p.Age)?.Age ?? int.MaxValue;
person
.Pets
.MinBy(p => p.Age)?
.Age ?? MaxValue;
}
}
4 changes: 2 additions & 2 deletions solution/c#/Day07/Day07/CI/Functional/Pipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class Pipeline(IConfig config, IEmailer emailer, ILogger log)
{
private const string Success = "success";

public void Run(Project project)
public Option<PipelineContext> Run(Project project)
=> ContextFor(project)
.Bind(RunTests)
.Bind(Deploy);
Expand Down Expand Up @@ -77,7 +77,7 @@ private void SendEmail(String text)
emailer.Send(text);
}

private sealed class PipelineContext(Project project)
public sealed class PipelineContext(Project project)
{
public bool MustRunDeployment() => TestsRanSuccessfully || !HasTests;

Expand Down
4 changes: 2 additions & 2 deletions solution/c#/Day07/Day07/CI/Pipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public void Run(Project project)
return;
}

if (DunDeploymentFailed(project))
if (RunDeploymentFailed(project))
{
SendEmail("Deployment failed");
return;
Expand All @@ -41,7 +41,7 @@ private bool RunTestsFailed(Project project)
return false;
}

private bool DunDeploymentFailed(Project project)
private bool RunDeploymentFailed(Project project)
{
if (project.Deploy() == Success)
{
Expand Down
2 changes: 1 addition & 1 deletion solution/c#/Day11/Day11/RomanNumerals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static class RomanNumerals

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

public static Option<string> Convert(int number)
private static Option<string> Convert(int number)
=> IsInRange(number)
? ConvertSafely(number)
: None;
Expand Down

0 comments on commit 244e172

Please sign in to comment.