Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(day14): C# - Assertion hide LanguageExt.Map preserve order issue #4

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion solution/c#/Day14/Day14.Tests/LangExt/FizzBuzzTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void Returns_Number_Representation(int input, string expectedResult)
=> Day14.LangExt.FizzBuzz
.Convert(input)
.Should()
.BeSome(expectedResult);
.Be(expectedResult);

[Theory]
[InlineData(0)]
Expand Down
13 changes: 7 additions & 6 deletions solution/c#/Day14/Day14/LangExt/FizzBuzz.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ public static class FizzBuzz
private const int Min = 1;
private const int Max = 100;

private static readonly Map<int, string> Mapping =
Map.create(
(15, "FizzBuzz"),
(3, "Fizz"),
(5, "Buzz")
);
private static readonly Dictionary<int, string> Mapping =
new()
{
{ 15, "FizzBuzz" },
{ 3, "Fizz" },
{ 5, "Buzz" }
};

public static Option<string> Convert(int input)
=> IsOutOfRange(input)
Expand Down