Skip to content

Commit

Permalink
Add awesome customization examples to README 🤩
Browse files Browse the repository at this point in the history
  • Loading branch information
eduherminio committed Dec 7, 2022
1 parent e4874d7 commit b2022b0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 29 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ You can also:
## Testing

- Example of simple AoC solutions testing: [SampleTests](tests/AoCHelper.Test/SampleTests.cs)
- Example of advanced AoC solutions testing by providing a custom input test filepath: [ModifyInputFilePathTests_SampleTests](tests/AoCHelper.Test/ModifyInputFilePathTests_SampleTests.cs)
- Example of advanced AoC solutions testing by providing a custom input test dir path: [ModifyInputFileDirPath_SampleTests](tests/AoCHelper.Test/ModifyInputFileDirPath_SampleTests.cs)
- Example of advanced AoC solutions testing by providing a custom input test filepath: [ModifyInputFilePathTests_SampleTests](tests/AoCHelper.Test/ModifyInputFilePathTests_SampleTests.cs)
- Example of advanced AoC solutions testing by providing a custom input test dir path: [ModifyInputFileDirPath_SampleTests](tests/AoCHelper.Test/ModifyInputFileDirPath_SampleTests.cs)

## Usage examples

Expand All @@ -86,6 +86,11 @@ Example projects can be found at:
- [AoC2020](https://github.com/eduherminio/AoC2020) (v0.x)
- [All these repositories](https://github.com/eduherminio/AoCHelper/network/dependents)

Some cool repositories that add their own abstractions/customizations on top of `AocHelper`:

- [RachaelBooth/AdventOfCode2022](https://github.com/RachaelBooth/AdventOfCode2022/): `BaseSolver<U>` and `BaseSolver<U, V>` wrappers around `BaseProblem` to have `U Solve1()` and `V Solve2` methods.
- [Morphix84/AdventOfCode](https://github.com/Morphix84/AdventOfCode/): input fetching and same-repository-multi-year support.

## `v1` to `v2` migration

Methods that accept an instance of `SolverConfiguration` are deprecated in `v2` and can expected to be removed in the next major version.
Expand Down Expand Up @@ -176,7 +181,7 @@ public class Day_01 : BaseDay
Your problem classes are instantiated only once, so parsing the input file (`InputFilePath`) in your class constructor allows you to:

- Avoid executing parsing logic twice per problem.
- Measure more accurately your part 1 and part 2 solutions performance*.
- Measure more accurately your part 1 and part 2 solutions performance\*.

\* Consider enabling `ShowConstructorElapsedTime` and `ShowTotalElapsedTimePerDay` in `Action<SolverConfiguration>`.

Expand Down
13 changes: 0 additions & 13 deletions tests/AoCHelper.Test/ModifyInputFileDirPath_SampleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,3 @@ public async Task ModifyInputFileDirPath(Type type, string inputFileDirPath, str
}
}
}

/*
Hi Mael,
First of all, thanks for using AoCHelper and for your kind words. And apologies for the delay, it's being a hectic week.
I can think of two ways of making this work: changing `InputFilePath` or `InputFileDirPath` to accomodate test files/dirs.
As you probably noticed, those properties don't have a setter, and therefore cannot be modified in an obvious way from a external test method.
Since the beginning of this library I've wanted to give a proper thought to testing solutions
I'll note your suggestion down
*/
13 changes: 0 additions & 13 deletions tests/AoCHelper.Test/ModifyInputFilePathTests_SampleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,3 @@ public async Task ModifyInputFilePath(Type type, string inputFilePath, string so
}
}
}

/*
Hi Mael,
First of all, thanks for using AoCHelper and for your kind words. And apologies for the delay, it's being a hectic week.
I can think of two ways of making this work: changing `InputFilePath` or `InputFileDirPath` to accomodate test files/dirs.
As you probably noticed, those properties don't have a setter, and therefore cannot be modified in an obvious way from a external test method.
Since the beginning of this library I've wanted to give a proper thought to testing solutions
I'll note your suggestion down
*/

0 comments on commit b2022b0

Please sign in to comment.