From ff016f308e27b789333b481c11042ef792705c1b Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Mon, 17 Feb 2025 15:10:28 +0100 Subject: [PATCH 01/32] Enable nullable --- .../concept/annalyns-infiltration/AnnalynsInfiltration.csproj | 1 + exercises/concept/attack-of-the-trolls/AttackOfTheTrolls.csproj | 1 + .../concept/authentication-system/AuthenticationSystem.csproj | 1 + .../beauty-salon-goes-global/BeautySalonGoesGlobal.csproj | 1 + exercises/concept/bird-watcher/BirdWatcher.csproj | 1 + .../concept/booking-up-for-beauty/BookingUpForBeauty.csproj | 1 + exercises/concept/building-telemetry/BuildingTelemetry.csproj | 1 + .../concept/calculator-conundrum/CalculatorConundrum.csproj | 1 + exercises/concept/cars-assemble/CarsAssemble.csproj | 1 + .../concept/developer-privileges/DeveloperPrivileges.csproj | 1 + exercises/concept/elons-toys/ElonsToys.csproj | 1 + exercises/concept/faceid-2/Faceid2.csproj | 1 + .../concept/football-match-reports/FootballMatchReports.csproj | 1 + .../concept/high-school-sweethearts/HighSchoolSweethearts.csproj | 1 + .../hyper-optimized-telemetry/HyperOptimizedTelemetry.csproj | 1 + exercises/concept/hyperia-forex/HyperiaForex.csproj | 1 + .../hyperinflation-hits-hyperia/HyperinflationHitsHyperia.csproj | 1 + exercises/concept/instruments-of-texas/InstrumentsOfTexas.csproj | 1 + .../concept/interest-is-interesting/InterestIsInteresting.csproj | 1 + .../InternationalCallingConnoisseur.csproj | 1 + exercises/concept/land-grab-in-space/LandGrabInSpace.csproj | 1 + exercises/concept/log-analysis/LogAnalysis.csproj | 1 + exercises/concept/log-levels/LogLevels.csproj | 1 + exercises/concept/logs-logs-logs/LogsLogsLogs.csproj | 1 + .../lucians-luscious-lasagna/LuciansLusciousLasagna.csproj | 1 + exercises/concept/need-for-speed/NeedForSpeed.csproj | 1 + .../object-relational-mapping/ObjectRelationalMapping.csproj | 1 + exercises/concept/orm-in-one-go/OrmInOneGo.csproj | 1 + exercises/concept/parsing-log-files/ParsingLogFiles.csproj | 1 + .../concept/phone-number-analysis/PhoneNumberAnalysis.csproj | 1 + .../concept/red-vs-blue-darwin-style/RedVsBlueDarwinStyle.csproj | 1 + .../concept/remote-control-cleanup/RemoteControlCleanup.csproj | 1 + .../remote-control-competition/RemoteControlCompetition.csproj | 1 + exercises/concept/roll-the-die/RollTheDie.csproj | 1 + .../secure-munchester-united/SecureMunchesterUnited.csproj | 1 + exercises/concept/squeaky-clean/SqueakyClean.csproj | 1 + .../concept/the-weather-in-deather/TheWeatherInDeather.csproj | 1 + exercises/concept/tim-from-marketing/TimFromMarketing.csproj | 1 + .../tracks-on-tracks-on-tracks/TracksOnTracksOnTracks.csproj | 1 + exercises/concept/weighing-machine/WeighingMachine.csproj | 1 + .../concept/wizards-and-warriors-2/WizardsAndWarriors2.csproj | 1 + exercises/concept/wizards-and-warriors/WizardsAndWarriors.csproj | 1 + exercises/practice/accumulate/Accumulate.csproj | 1 + exercises/practice/acronym/Acronym.csproj | 1 + exercises/practice/affine-cipher/AffineCipher.csproj | 1 + exercises/practice/all-your-base/AllYourBase.csproj | 1 + exercises/practice/allergies/Allergies.csproj | 1 + exercises/practice/alphametics/Alphametics.csproj | 1 + exercises/practice/anagram/Anagram.csproj | 1 + exercises/practice/armstrong-numbers/ArmstrongNumbers.csproj | 1 + exercises/practice/atbash-cipher/AtbashCipher.csproj | 1 + exercises/practice/bank-account/BankAccount.csproj | 1 + exercises/practice/beer-song/BeerSong.csproj | 1 + exercises/practice/binary-search-tree/BinarySearchTree.csproj | 1 + exercises/practice/binary-search/BinarySearch.csproj | 1 + exercises/practice/binary/Binary.csproj | 1 + .../bob/.articles/performance/code/Benchmark_Csharp.csproj | 1 + exercises/practice/bob/Bob.csproj | 1 + exercises/practice/book-store/BookStore.csproj | 1 + exercises/practice/bowling/Bowling.csproj | 1 + exercises/practice/change/Change.csproj | 1 + exercises/practice/circular-buffer/CircularBuffer.csproj | 1 + exercises/practice/clock/Clock.csproj | 1 + exercises/practice/collatz-conjecture/CollatzConjecture.csproj | 1 + exercises/practice/complex-numbers/ComplexNumbers.csproj | 1 + exercises/practice/connect/Connect.csproj | 1 + exercises/practice/crypto-square/CryptoSquare.csproj | 1 + exercises/practice/custom-set/CustomSet.csproj | 1 + exercises/practice/darts/Darts.csproj | 1 + exercises/practice/diamond/Diamond.csproj | 1 + .../practice/difference-of-squares/DifferenceOfSquares.csproj | 1 + exercises/practice/diffie-hellman/DiffieHellman.csproj | 1 + exercises/practice/dnd-character/DndCharacter.csproj | 1 + exercises/practice/dominoes/Dominoes.csproj | 1 + exercises/practice/dot-dsl/DotDsl.csproj | 1 + exercises/practice/eliuds-eggs/EliudsEggs.csproj | 1 + exercises/practice/error-handling/ErrorHandling.csproj | 1 + exercises/practice/etl/Etl.csproj | 1 + exercises/practice/flatten-array/FlattenArray.csproj | 1 + exercises/practice/food-chain/FoodChain.csproj | 1 + exercises/practice/forth/Forth.csproj | 1 + exercises/practice/game-of-life/GameOfLife.csproj | 1 + exercises/practice/gigasecond/Gigasecond.csproj | 1 + exercises/practice/go-counting/GoCounting.csproj | 1 + exercises/practice/grade-school/GradeSchool.csproj | 1 + .../grains/.articles/performance/code/Benchmark_Csharp.csproj | 1 + exercises/practice/grains/Grains.csproj | 1 + exercises/practice/grep/Grep.csproj | 1 + exercises/practice/hamming/Hamming.csproj | 1 + exercises/practice/hangman/Hangman.csproj | 1 + exercises/practice/hello-world/HelloWorld.csproj | 1 + exercises/practice/hexadecimal/Hexadecimal.csproj | 1 + exercises/practice/high-scores/HighScores.csproj | 1 + exercises/practice/house/House.csproj | 1 + exercises/practice/isbn-verifier/IsbnVerifier.csproj | 1 + .../isogram/.articles/performance/code/Benchmark_Csharp.csproj | 1 + exercises/practice/isogram/Isogram.csproj | 1 + .../practice/killer-sudoku-helper/KillerSudokuHelper.csproj | 1 + exercises/practice/kindergarten-garden/KindergartenGarden.csproj | 1 + exercises/practice/knapsack/Knapsack.csproj | 1 + .../practice/largest-series-product/LargestSeriesProduct.csproj | 1 + .../leap/.articles/performance/code/Benchmark_Csharp.csproj | 1 + exercises/practice/leap/Leap.csproj | 1 + exercises/practice/ledger/Ledger.csproj | 1 + exercises/practice/linked-list/LinkedList.csproj | 1 + exercises/practice/list-ops/ListOps.csproj | 1 + exercises/practice/luhn/Luhn.csproj | 1 + exercises/practice/markdown/Markdown.csproj | 1 + exercises/practice/matching-brackets/MatchingBrackets.csproj | 1 + exercises/practice/matrix/Matrix.csproj | 1 + exercises/practice/meetup/Meetup.csproj | 1 + exercises/practice/minesweeper/Minesweeper.csproj | 1 + exercises/practice/nth-prime/NthPrime.csproj | 1 + exercises/practice/nucleotide-count/NucleotideCount.csproj | 1 + exercises/practice/ocr-numbers/OcrNumbers.csproj | 1 + exercises/practice/octal/Octal.csproj | 1 + .../is-palindrome-check/code/BenchmarkIsPalindrome.csproj | 1 + exercises/practice/palindrome-products/PalindromeProducts.csproj | 1 + .../pangram/.articles/performance/code/Benchmark_Csharp.csproj | 1 + exercises/practice/pangram/Pangram.csproj | 1 + .../parallel-letter-frequency/ParallelLetterFrequency.csproj | 1 + exercises/practice/pascals-triangle/PascalsTriangle.csproj | 1 + exercises/practice/perfect-numbers/PerfectNumbers.csproj | 1 + exercises/practice/phone-number/PhoneNumber.csproj | 1 + exercises/practice/pig-latin/PigLatin.csproj | 1 + exercises/practice/poker/Poker.csproj | 1 + exercises/practice/pov/Pov.csproj | 1 + exercises/practice/prime-factors/PrimeFactors.csproj | 1 + .../.articles/performance/code/Benchmark_Csharp.csproj | 1 + exercises/practice/protein-translation/ProteinTranslation.csproj | 1 + exercises/practice/proverb/Proverb.csproj | 1 + exercises/practice/pythagorean-triplet/PythagoreanTriplet.csproj | 1 + exercises/practice/queen-attack/QueenAttack.csproj | 1 + exercises/practice/rail-fence-cipher/RailFenceCipher.csproj | 1 + .../raindrops/.articles/performance/code/Benchmark_Csharp.csproj | 1 + exercises/practice/raindrops/Raindrops.csproj | 1 + exercises/practice/rational-numbers/RationalNumbers.csproj | 1 + exercises/practice/react/React.csproj | 1 + exercises/practice/rectangles/Rectangles.csproj | 1 + exercises/practice/resistor-color-duo/ResistorColorDuo.csproj | 1 + exercises/practice/resistor-color-trio/ResistorColorTrio.csproj | 1 + exercises/practice/resistor-color/ResistorColor.csproj | 1 + exercises/practice/rest-api/RestApi.csproj | 1 + .../reverse-string/.articles/performance/code/Benchmark.csproj | 1 + exercises/practice/reverse-string/ReverseString.csproj | 1 + exercises/practice/rna-transcription/RnaTranscription.csproj | 1 + exercises/practice/robot-name/RobotName.csproj | 1 + exercises/practice/robot-simulator/RobotSimulator.csproj | 1 + exercises/practice/roman-numerals/RomanNumerals.csproj | 1 + exercises/practice/rotational-cipher/RotationalCipher.csproj | 1 + exercises/practice/run-length-encoding/RunLengthEncoding.csproj | 1 + exercises/practice/saddle-points/SaddlePoints.csproj | 1 + exercises/practice/satellite/Satellite.csproj | 1 + exercises/practice/say/Say.csproj | 1 + exercises/practice/scale-generator/ScaleGenerator.csproj | 1 + exercises/practice/scrabble-score/ScrabbleScore.csproj | 1 + exercises/practice/secret-handshake/SecretHandshake.csproj | 1 + exercises/practice/series/Series.csproj | 1 + exercises/practice/sgf-parsing/SgfParsing.csproj | 1 + .../practice/sieve/.articles/performance/code/Benchmark.csproj | 1 + exercises/practice/sieve/Sieve.csproj | 1 + exercises/practice/simple-cipher/SimpleCipher.csproj | 1 + exercises/practice/simple-linked-list/SimpleLinkedList.csproj | 1 + exercises/practice/space-age/SpaceAge.csproj | 1 + exercises/practice/spiral-matrix/SpiralMatrix.csproj | 1 + exercises/practice/square-root/SquareRoot.csproj | 1 + exercises/practice/state-of-tic-tac-toe/StateOfTicTacToe.csproj | 1 + exercises/practice/strain/Strain.csproj | 1 + exercises/practice/sublist/Sublist.csproj | 1 + exercises/practice/sum-of-multiples/SumOfMultiples.csproj | 1 + exercises/practice/tournament/Tournament.csproj | 1 + exercises/practice/transpose/Transpose.csproj | 1 + exercises/practice/tree-building/TreeBuilding.csproj | 1 + exercises/practice/triangle/Triangle.csproj | 1 + exercises/practice/trinary/Trinary.csproj | 1 + exercises/practice/twelve-days/TwelveDays.csproj | 1 + exercises/practice/two-bucket/TwoBucket.csproj | 1 + exercises/practice/two-fer/TwoFer.csproj | 1 + .../variable-length-quantity/VariableLengthQuantity.csproj | 1 + exercises/practice/word-count/WordCount.csproj | 1 + exercises/practice/word-search/WordSearch.csproj | 1 + exercises/practice/wordy/Wordy.csproj | 1 + exercises/practice/yacht/Yacht.csproj | 1 + exercises/practice/zebra-puzzle/ZebraPuzzle.csproj | 1 + exercises/practice/zipper/Zipper.csproj | 1 + 185 files changed, 185 insertions(+) diff --git a/exercises/concept/annalyns-infiltration/AnnalynsInfiltration.csproj b/exercises/concept/annalyns-infiltration/AnnalynsInfiltration.csproj index 53f95ed2a5..7625d0c3c3 100644 --- a/exercises/concept/annalyns-infiltration/AnnalynsInfiltration.csproj +++ b/exercises/concept/annalyns-infiltration/AnnalynsInfiltration.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/attack-of-the-trolls/AttackOfTheTrolls.csproj b/exercises/concept/attack-of-the-trolls/AttackOfTheTrolls.csproj index 53f95ed2a5..7625d0c3c3 100644 --- a/exercises/concept/attack-of-the-trolls/AttackOfTheTrolls.csproj +++ b/exercises/concept/attack-of-the-trolls/AttackOfTheTrolls.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/authentication-system/AuthenticationSystem.csproj b/exercises/concept/authentication-system/AuthenticationSystem.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/authentication-system/AuthenticationSystem.csproj +++ b/exercises/concept/authentication-system/AuthenticationSystem.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/beauty-salon-goes-global/BeautySalonGoesGlobal.csproj b/exercises/concept/beauty-salon-goes-global/BeautySalonGoesGlobal.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/beauty-salon-goes-global/BeautySalonGoesGlobal.csproj +++ b/exercises/concept/beauty-salon-goes-global/BeautySalonGoesGlobal.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/bird-watcher/BirdWatcher.csproj b/exercises/concept/bird-watcher/BirdWatcher.csproj index be81264495..8b75d52b07 100644 --- a/exercises/concept/bird-watcher/BirdWatcher.csproj +++ b/exercises/concept/bird-watcher/BirdWatcher.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/booking-up-for-beauty/BookingUpForBeauty.csproj b/exercises/concept/booking-up-for-beauty/BookingUpForBeauty.csproj index 53f95ed2a5..7625d0c3c3 100644 --- a/exercises/concept/booking-up-for-beauty/BookingUpForBeauty.csproj +++ b/exercises/concept/booking-up-for-beauty/BookingUpForBeauty.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/building-telemetry/BuildingTelemetry.csproj b/exercises/concept/building-telemetry/BuildingTelemetry.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/building-telemetry/BuildingTelemetry.csproj +++ b/exercises/concept/building-telemetry/BuildingTelemetry.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/calculator-conundrum/CalculatorConundrum.csproj b/exercises/concept/calculator-conundrum/CalculatorConundrum.csproj index 34a056ea9c..54d543da1b 100644 --- a/exercises/concept/calculator-conundrum/CalculatorConundrum.csproj +++ b/exercises/concept/calculator-conundrum/CalculatorConundrum.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/cars-assemble/CarsAssemble.csproj b/exercises/concept/cars-assemble/CarsAssemble.csproj index 53f95ed2a5..7625d0c3c3 100644 --- a/exercises/concept/cars-assemble/CarsAssemble.csproj +++ b/exercises/concept/cars-assemble/CarsAssemble.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/developer-privileges/DeveloperPrivileges.csproj b/exercises/concept/developer-privileges/DeveloperPrivileges.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/developer-privileges/DeveloperPrivileges.csproj +++ b/exercises/concept/developer-privileges/DeveloperPrivileges.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/elons-toys/ElonsToys.csproj b/exercises/concept/elons-toys/ElonsToys.csproj index 53f95ed2a5..7625d0c3c3 100644 --- a/exercises/concept/elons-toys/ElonsToys.csproj +++ b/exercises/concept/elons-toys/ElonsToys.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/faceid-2/Faceid2.csproj b/exercises/concept/faceid-2/Faceid2.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/faceid-2/Faceid2.csproj +++ b/exercises/concept/faceid-2/Faceid2.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/football-match-reports/FootballMatchReports.csproj b/exercises/concept/football-match-reports/FootballMatchReports.csproj index 590e2b629e..85d763a267 100644 --- a/exercises/concept/football-match-reports/FootballMatchReports.csproj +++ b/exercises/concept/football-match-reports/FootballMatchReports.csproj @@ -3,6 +3,7 @@ net9.0 enable + enable true diff --git a/exercises/concept/high-school-sweethearts/HighSchoolSweethearts.csproj b/exercises/concept/high-school-sweethearts/HighSchoolSweethearts.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/high-school-sweethearts/HighSchoolSweethearts.csproj +++ b/exercises/concept/high-school-sweethearts/HighSchoolSweethearts.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/hyper-optimized-telemetry/HyperOptimizedTelemetry.csproj b/exercises/concept/hyper-optimized-telemetry/HyperOptimizedTelemetry.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/hyper-optimized-telemetry/HyperOptimizedTelemetry.csproj +++ b/exercises/concept/hyper-optimized-telemetry/HyperOptimizedTelemetry.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/hyperia-forex/HyperiaForex.csproj b/exercises/concept/hyperia-forex/HyperiaForex.csproj index 0c1593de15..508bd277fa 100644 --- a/exercises/concept/hyperia-forex/HyperiaForex.csproj +++ b/exercises/concept/hyperia-forex/HyperiaForex.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/hyperinflation-hits-hyperia/HyperinflationHitsHyperia.csproj b/exercises/concept/hyperinflation-hits-hyperia/HyperinflationHitsHyperia.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/hyperinflation-hits-hyperia/HyperinflationHitsHyperia.csproj +++ b/exercises/concept/hyperinflation-hits-hyperia/HyperinflationHitsHyperia.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/instruments-of-texas/InstrumentsOfTexas.csproj b/exercises/concept/instruments-of-texas/InstrumentsOfTexas.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/instruments-of-texas/InstrumentsOfTexas.csproj +++ b/exercises/concept/instruments-of-texas/InstrumentsOfTexas.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/interest-is-interesting/InterestIsInteresting.csproj b/exercises/concept/interest-is-interesting/InterestIsInteresting.csproj index 53f95ed2a5..7625d0c3c3 100644 --- a/exercises/concept/interest-is-interesting/InterestIsInteresting.csproj +++ b/exercises/concept/interest-is-interesting/InterestIsInteresting.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/international-calling-connoisseur/InternationalCallingConnoisseur.csproj b/exercises/concept/international-calling-connoisseur/InternationalCallingConnoisseur.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/international-calling-connoisseur/InternationalCallingConnoisseur.csproj +++ b/exercises/concept/international-calling-connoisseur/InternationalCallingConnoisseur.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/land-grab-in-space/LandGrabInSpace.csproj b/exercises/concept/land-grab-in-space/LandGrabInSpace.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/land-grab-in-space/LandGrabInSpace.csproj +++ b/exercises/concept/land-grab-in-space/LandGrabInSpace.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/log-analysis/LogAnalysis.csproj b/exercises/concept/log-analysis/LogAnalysis.csproj index 34a056ea9c..54d543da1b 100644 --- a/exercises/concept/log-analysis/LogAnalysis.csproj +++ b/exercises/concept/log-analysis/LogAnalysis.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/log-levels/LogLevels.csproj b/exercises/concept/log-levels/LogLevels.csproj index 53f95ed2a5..7625d0c3c3 100644 --- a/exercises/concept/log-levels/LogLevels.csproj +++ b/exercises/concept/log-levels/LogLevels.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/logs-logs-logs/LogsLogsLogs.csproj b/exercises/concept/logs-logs-logs/LogsLogsLogs.csproj index 53f95ed2a5..7625d0c3c3 100644 --- a/exercises/concept/logs-logs-logs/LogsLogsLogs.csproj +++ b/exercises/concept/logs-logs-logs/LogsLogsLogs.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/lucians-luscious-lasagna/LuciansLusciousLasagna.csproj b/exercises/concept/lucians-luscious-lasagna/LuciansLusciousLasagna.csproj index 53f95ed2a5..7625d0c3c3 100644 --- a/exercises/concept/lucians-luscious-lasagna/LuciansLusciousLasagna.csproj +++ b/exercises/concept/lucians-luscious-lasagna/LuciansLusciousLasagna.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/need-for-speed/NeedForSpeed.csproj b/exercises/concept/need-for-speed/NeedForSpeed.csproj index 53f95ed2a5..7625d0c3c3 100644 --- a/exercises/concept/need-for-speed/NeedForSpeed.csproj +++ b/exercises/concept/need-for-speed/NeedForSpeed.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/object-relational-mapping/ObjectRelationalMapping.csproj b/exercises/concept/object-relational-mapping/ObjectRelationalMapping.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/object-relational-mapping/ObjectRelationalMapping.csproj +++ b/exercises/concept/object-relational-mapping/ObjectRelationalMapping.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/orm-in-one-go/OrmInOneGo.csproj b/exercises/concept/orm-in-one-go/OrmInOneGo.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/orm-in-one-go/OrmInOneGo.csproj +++ b/exercises/concept/orm-in-one-go/OrmInOneGo.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/parsing-log-files/ParsingLogFiles.csproj b/exercises/concept/parsing-log-files/ParsingLogFiles.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/parsing-log-files/ParsingLogFiles.csproj +++ b/exercises/concept/parsing-log-files/ParsingLogFiles.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/phone-number-analysis/PhoneNumberAnalysis.csproj b/exercises/concept/phone-number-analysis/PhoneNumberAnalysis.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/phone-number-analysis/PhoneNumberAnalysis.csproj +++ b/exercises/concept/phone-number-analysis/PhoneNumberAnalysis.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/red-vs-blue-darwin-style/RedVsBlueDarwinStyle.csproj b/exercises/concept/red-vs-blue-darwin-style/RedVsBlueDarwinStyle.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/red-vs-blue-darwin-style/RedVsBlueDarwinStyle.csproj +++ b/exercises/concept/red-vs-blue-darwin-style/RedVsBlueDarwinStyle.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/remote-control-cleanup/RemoteControlCleanup.csproj b/exercises/concept/remote-control-cleanup/RemoteControlCleanup.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/remote-control-cleanup/RemoteControlCleanup.csproj +++ b/exercises/concept/remote-control-cleanup/RemoteControlCleanup.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/remote-control-competition/RemoteControlCompetition.csproj b/exercises/concept/remote-control-competition/RemoteControlCompetition.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/remote-control-competition/RemoteControlCompetition.csproj +++ b/exercises/concept/remote-control-competition/RemoteControlCompetition.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/roll-the-die/RollTheDie.csproj b/exercises/concept/roll-the-die/RollTheDie.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/roll-the-die/RollTheDie.csproj +++ b/exercises/concept/roll-the-die/RollTheDie.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/secure-munchester-united/SecureMunchesterUnited.csproj b/exercises/concept/secure-munchester-united/SecureMunchesterUnited.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/secure-munchester-united/SecureMunchesterUnited.csproj +++ b/exercises/concept/secure-munchester-united/SecureMunchesterUnited.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/squeaky-clean/SqueakyClean.csproj b/exercises/concept/squeaky-clean/SqueakyClean.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/squeaky-clean/SqueakyClean.csproj +++ b/exercises/concept/squeaky-clean/SqueakyClean.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/the-weather-in-deather/TheWeatherInDeather.csproj b/exercises/concept/the-weather-in-deather/TheWeatherInDeather.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/the-weather-in-deather/TheWeatherInDeather.csproj +++ b/exercises/concept/the-weather-in-deather/TheWeatherInDeather.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/tim-from-marketing/TimFromMarketing.csproj b/exercises/concept/tim-from-marketing/TimFromMarketing.csproj index 590e2b629e..85d763a267 100644 --- a/exercises/concept/tim-from-marketing/TimFromMarketing.csproj +++ b/exercises/concept/tim-from-marketing/TimFromMarketing.csproj @@ -3,6 +3,7 @@ net9.0 enable + enable true diff --git a/exercises/concept/tracks-on-tracks-on-tracks/TracksOnTracksOnTracks.csproj b/exercises/concept/tracks-on-tracks-on-tracks/TracksOnTracksOnTracks.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/tracks-on-tracks-on-tracks/TracksOnTracksOnTracks.csproj +++ b/exercises/concept/tracks-on-tracks-on-tracks/TracksOnTracksOnTracks.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/weighing-machine/WeighingMachine.csproj b/exercises/concept/weighing-machine/WeighingMachine.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/concept/weighing-machine/WeighingMachine.csproj +++ b/exercises/concept/weighing-machine/WeighingMachine.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/wizards-and-warriors-2/WizardsAndWarriors2.csproj b/exercises/concept/wizards-and-warriors-2/WizardsAndWarriors2.csproj index 53f95ed2a5..7625d0c3c3 100644 --- a/exercises/concept/wizards-and-warriors-2/WizardsAndWarriors2.csproj +++ b/exercises/concept/wizards-and-warriors-2/WizardsAndWarriors2.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/concept/wizards-and-warriors/WizardsAndWarriors.csproj b/exercises/concept/wizards-and-warriors/WizardsAndWarriors.csproj index 53f95ed2a5..7625d0c3c3 100644 --- a/exercises/concept/wizards-and-warriors/WizardsAndWarriors.csproj +++ b/exercises/concept/wizards-and-warriors/WizardsAndWarriors.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/accumulate/Accumulate.csproj b/exercises/practice/accumulate/Accumulate.csproj index 48c7eb9659..73826fe6c9 100644 --- a/exercises/practice/accumulate/Accumulate.csproj +++ b/exercises/practice/accumulate/Accumulate.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/acronym/Acronym.csproj b/exercises/practice/acronym/Acronym.csproj index b4fd39c095..b0f97fdf79 100644 --- a/exercises/practice/acronym/Acronym.csproj +++ b/exercises/practice/acronym/Acronym.csproj @@ -3,6 +3,7 @@ net9.0 + enable true diff --git a/exercises/practice/affine-cipher/AffineCipher.csproj b/exercises/practice/affine-cipher/AffineCipher.csproj index e1a3b4466f..1b40aeb201 100644 --- a/exercises/practice/affine-cipher/AffineCipher.csproj +++ b/exercises/practice/affine-cipher/AffineCipher.csproj @@ -3,6 +3,7 @@ Exe net9.0 + enable true diff --git a/exercises/practice/all-your-base/AllYourBase.csproj b/exercises/practice/all-your-base/AllYourBase.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/all-your-base/AllYourBase.csproj +++ b/exercises/practice/all-your-base/AllYourBase.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/allergies/Allergies.csproj b/exercises/practice/allergies/Allergies.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/allergies/Allergies.csproj +++ b/exercises/practice/allergies/Allergies.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/alphametics/Alphametics.csproj b/exercises/practice/alphametics/Alphametics.csproj index 2374c328aa..5544c7f0f6 100644 --- a/exercises/practice/alphametics/Alphametics.csproj +++ b/exercises/practice/alphametics/Alphametics.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/anagram/Anagram.csproj b/exercises/practice/anagram/Anagram.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/anagram/Anagram.csproj +++ b/exercises/practice/anagram/Anagram.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/armstrong-numbers/ArmstrongNumbers.csproj b/exercises/practice/armstrong-numbers/ArmstrongNumbers.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/armstrong-numbers/ArmstrongNumbers.csproj +++ b/exercises/practice/armstrong-numbers/ArmstrongNumbers.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/atbash-cipher/AtbashCipher.csproj b/exercises/practice/atbash-cipher/AtbashCipher.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/atbash-cipher/AtbashCipher.csproj +++ b/exercises/practice/atbash-cipher/AtbashCipher.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/bank-account/BankAccount.csproj b/exercises/practice/bank-account/BankAccount.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/bank-account/BankAccount.csproj +++ b/exercises/practice/bank-account/BankAccount.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/beer-song/BeerSong.csproj b/exercises/practice/beer-song/BeerSong.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/beer-song/BeerSong.csproj +++ b/exercises/practice/beer-song/BeerSong.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/binary-search-tree/BinarySearchTree.csproj b/exercises/practice/binary-search-tree/BinarySearchTree.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/binary-search-tree/BinarySearchTree.csproj +++ b/exercises/practice/binary-search-tree/BinarySearchTree.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/binary-search/BinarySearch.csproj b/exercises/practice/binary-search/BinarySearch.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/binary-search/BinarySearch.csproj +++ b/exercises/practice/binary-search/BinarySearch.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/binary/Binary.csproj b/exercises/practice/binary/Binary.csproj index 09fcf4d6ea..5553da3b47 100644 --- a/exercises/practice/binary/Binary.csproj +++ b/exercises/practice/binary/Binary.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/bob/.articles/performance/code/Benchmark_Csharp.csproj b/exercises/practice/bob/.articles/performance/code/Benchmark_Csharp.csproj index 2ec2bf993c..3e9d5d040a 100644 --- a/exercises/practice/bob/.articles/performance/code/Benchmark_Csharp.csproj +++ b/exercises/practice/bob/.articles/performance/code/Benchmark_Csharp.csproj @@ -5,6 +5,7 @@ net9.0 enable enable + enable true diff --git a/exercises/practice/bob/Bob.csproj b/exercises/practice/bob/Bob.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/bob/Bob.csproj +++ b/exercises/practice/bob/Bob.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/book-store/BookStore.csproj b/exercises/practice/book-store/BookStore.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/book-store/BookStore.csproj +++ b/exercises/practice/book-store/BookStore.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/bowling/Bowling.csproj b/exercises/practice/bowling/Bowling.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/bowling/Bowling.csproj +++ b/exercises/practice/bowling/Bowling.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/change/Change.csproj b/exercises/practice/change/Change.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/change/Change.csproj +++ b/exercises/practice/change/Change.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/circular-buffer/CircularBuffer.csproj b/exercises/practice/circular-buffer/CircularBuffer.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/circular-buffer/CircularBuffer.csproj +++ b/exercises/practice/circular-buffer/CircularBuffer.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/clock/Clock.csproj b/exercises/practice/clock/Clock.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/clock/Clock.csproj +++ b/exercises/practice/clock/Clock.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/collatz-conjecture/CollatzConjecture.csproj b/exercises/practice/collatz-conjecture/CollatzConjecture.csproj index 53f95ed2a5..7625d0c3c3 100644 --- a/exercises/practice/collatz-conjecture/CollatzConjecture.csproj +++ b/exercises/practice/collatz-conjecture/CollatzConjecture.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/complex-numbers/ComplexNumbers.csproj b/exercises/practice/complex-numbers/ComplexNumbers.csproj index a5b5aa41c6..02b41704e4 100644 --- a/exercises/practice/complex-numbers/ComplexNumbers.csproj +++ b/exercises/practice/complex-numbers/ComplexNumbers.csproj @@ -3,6 +3,7 @@ net9.0 + enable true diff --git a/exercises/practice/connect/Connect.csproj b/exercises/practice/connect/Connect.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/connect/Connect.csproj +++ b/exercises/practice/connect/Connect.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/crypto-square/CryptoSquare.csproj b/exercises/practice/crypto-square/CryptoSquare.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/crypto-square/CryptoSquare.csproj +++ b/exercises/practice/crypto-square/CryptoSquare.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/custom-set/CustomSet.csproj b/exercises/practice/custom-set/CustomSet.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/custom-set/CustomSet.csproj +++ b/exercises/practice/custom-set/CustomSet.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/darts/Darts.csproj b/exercises/practice/darts/Darts.csproj index be81264495..8b75d52b07 100644 --- a/exercises/practice/darts/Darts.csproj +++ b/exercises/practice/darts/Darts.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/diamond/Diamond.csproj b/exercises/practice/diamond/Diamond.csproj index 2bac419d26..425016c2d0 100644 --- a/exercises/practice/diamond/Diamond.csproj +++ b/exercises/practice/diamond/Diamond.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/difference-of-squares/DifferenceOfSquares.csproj b/exercises/practice/difference-of-squares/DifferenceOfSquares.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/difference-of-squares/DifferenceOfSquares.csproj +++ b/exercises/practice/difference-of-squares/DifferenceOfSquares.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/diffie-hellman/DiffieHellman.csproj b/exercises/practice/diffie-hellman/DiffieHellman.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/diffie-hellman/DiffieHellman.csproj +++ b/exercises/practice/diffie-hellman/DiffieHellman.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/dnd-character/DndCharacter.csproj b/exercises/practice/dnd-character/DndCharacter.csproj index be81264495..8b75d52b07 100644 --- a/exercises/practice/dnd-character/DndCharacter.csproj +++ b/exercises/practice/dnd-character/DndCharacter.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/dominoes/Dominoes.csproj b/exercises/practice/dominoes/Dominoes.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/dominoes/Dominoes.csproj +++ b/exercises/practice/dominoes/Dominoes.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/dot-dsl/DotDsl.csproj b/exercises/practice/dot-dsl/DotDsl.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/dot-dsl/DotDsl.csproj +++ b/exercises/practice/dot-dsl/DotDsl.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/eliuds-eggs/EliudsEggs.csproj b/exercises/practice/eliuds-eggs/EliudsEggs.csproj index c97331f706..ce24685644 100644 --- a/exercises/practice/eliuds-eggs/EliudsEggs.csproj +++ b/exercises/practice/eliuds-eggs/EliudsEggs.csproj @@ -7,6 +7,7 @@ false true + enable true diff --git a/exercises/practice/error-handling/ErrorHandling.csproj b/exercises/practice/error-handling/ErrorHandling.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/error-handling/ErrorHandling.csproj +++ b/exercises/practice/error-handling/ErrorHandling.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/etl/Etl.csproj b/exercises/practice/etl/Etl.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/etl/Etl.csproj +++ b/exercises/practice/etl/Etl.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/flatten-array/FlattenArray.csproj b/exercises/practice/flatten-array/FlattenArray.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/flatten-array/FlattenArray.csproj +++ b/exercises/practice/flatten-array/FlattenArray.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/food-chain/FoodChain.csproj b/exercises/practice/food-chain/FoodChain.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/food-chain/FoodChain.csproj +++ b/exercises/practice/food-chain/FoodChain.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/forth/Forth.csproj b/exercises/practice/forth/Forth.csproj index 2374c328aa..5544c7f0f6 100644 --- a/exercises/practice/forth/Forth.csproj +++ b/exercises/practice/forth/Forth.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/game-of-life/GameOfLife.csproj b/exercises/practice/game-of-life/GameOfLife.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/game-of-life/GameOfLife.csproj +++ b/exercises/practice/game-of-life/GameOfLife.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/gigasecond/Gigasecond.csproj b/exercises/practice/gigasecond/Gigasecond.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/gigasecond/Gigasecond.csproj +++ b/exercises/practice/gigasecond/Gigasecond.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/go-counting/GoCounting.csproj b/exercises/practice/go-counting/GoCounting.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/go-counting/GoCounting.csproj +++ b/exercises/practice/go-counting/GoCounting.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/grade-school/GradeSchool.csproj b/exercises/practice/grade-school/GradeSchool.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/grade-school/GradeSchool.csproj +++ b/exercises/practice/grade-school/GradeSchool.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/grains/.articles/performance/code/Benchmark_Csharp.csproj b/exercises/practice/grains/.articles/performance/code/Benchmark_Csharp.csproj index 2ec2bf993c..3e9d5d040a 100644 --- a/exercises/practice/grains/.articles/performance/code/Benchmark_Csharp.csproj +++ b/exercises/practice/grains/.articles/performance/code/Benchmark_Csharp.csproj @@ -5,6 +5,7 @@ net9.0 enable enable + enable true diff --git a/exercises/practice/grains/Grains.csproj b/exercises/practice/grains/Grains.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/grains/Grains.csproj +++ b/exercises/practice/grains/Grains.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/grep/Grep.csproj b/exercises/practice/grep/Grep.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/grep/Grep.csproj +++ b/exercises/practice/grep/Grep.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/hamming/Hamming.csproj b/exercises/practice/hamming/Hamming.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/hamming/Hamming.csproj +++ b/exercises/practice/hamming/Hamming.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/hangman/Hangman.csproj b/exercises/practice/hangman/Hangman.csproj index c3258489c4..7f50231b9c 100644 --- a/exercises/practice/hangman/Hangman.csproj +++ b/exercises/practice/hangman/Hangman.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/hello-world/HelloWorld.csproj b/exercises/practice/hello-world/HelloWorld.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/hello-world/HelloWorld.csproj +++ b/exercises/practice/hello-world/HelloWorld.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/hexadecimal/Hexadecimal.csproj b/exercises/practice/hexadecimal/Hexadecimal.csproj index 09fcf4d6ea..5553da3b47 100644 --- a/exercises/practice/hexadecimal/Hexadecimal.csproj +++ b/exercises/practice/hexadecimal/Hexadecimal.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/high-scores/HighScores.csproj b/exercises/practice/high-scores/HighScores.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/high-scores/HighScores.csproj +++ b/exercises/practice/high-scores/HighScores.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/house/House.csproj b/exercises/practice/house/House.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/house/House.csproj +++ b/exercises/practice/house/House.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/isbn-verifier/IsbnVerifier.csproj b/exercises/practice/isbn-verifier/IsbnVerifier.csproj index 30782f1223..8df4cb6781 100644 --- a/exercises/practice/isbn-verifier/IsbnVerifier.csproj +++ b/exercises/practice/isbn-verifier/IsbnVerifier.csproj @@ -3,6 +3,7 @@ Exe net9.0 + enable true diff --git a/exercises/practice/isogram/.articles/performance/code/Benchmark_Csharp.csproj b/exercises/practice/isogram/.articles/performance/code/Benchmark_Csharp.csproj index 2ec2bf993c..3e9d5d040a 100644 --- a/exercises/practice/isogram/.articles/performance/code/Benchmark_Csharp.csproj +++ b/exercises/practice/isogram/.articles/performance/code/Benchmark_Csharp.csproj @@ -5,6 +5,7 @@ net9.0 enable enable + enable true diff --git a/exercises/practice/isogram/Isogram.csproj b/exercises/practice/isogram/Isogram.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/isogram/Isogram.csproj +++ b/exercises/practice/isogram/Isogram.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/killer-sudoku-helper/KillerSudokuHelper.csproj b/exercises/practice/killer-sudoku-helper/KillerSudokuHelper.csproj index be81264495..8b75d52b07 100644 --- a/exercises/practice/killer-sudoku-helper/KillerSudokuHelper.csproj +++ b/exercises/practice/killer-sudoku-helper/KillerSudokuHelper.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/kindergarten-garden/KindergartenGarden.csproj b/exercises/practice/kindergarten-garden/KindergartenGarden.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/kindergarten-garden/KindergartenGarden.csproj +++ b/exercises/practice/kindergarten-garden/KindergartenGarden.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/knapsack/Knapsack.csproj b/exercises/practice/knapsack/Knapsack.csproj index c97331f706..ce24685644 100644 --- a/exercises/practice/knapsack/Knapsack.csproj +++ b/exercises/practice/knapsack/Knapsack.csproj @@ -7,6 +7,7 @@ false true + enable true diff --git a/exercises/practice/largest-series-product/LargestSeriesProduct.csproj b/exercises/practice/largest-series-product/LargestSeriesProduct.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/largest-series-product/LargestSeriesProduct.csproj +++ b/exercises/practice/largest-series-product/LargestSeriesProduct.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/leap/.articles/performance/code/Benchmark_Csharp.csproj b/exercises/practice/leap/.articles/performance/code/Benchmark_Csharp.csproj index 2ec2bf993c..3e9d5d040a 100644 --- a/exercises/practice/leap/.articles/performance/code/Benchmark_Csharp.csproj +++ b/exercises/practice/leap/.articles/performance/code/Benchmark_Csharp.csproj @@ -5,6 +5,7 @@ net9.0 enable enable + enable true diff --git a/exercises/practice/leap/Leap.csproj b/exercises/practice/leap/Leap.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/leap/Leap.csproj +++ b/exercises/practice/leap/Leap.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/ledger/Ledger.csproj b/exercises/practice/ledger/Ledger.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/ledger/Ledger.csproj +++ b/exercises/practice/ledger/Ledger.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/linked-list/LinkedList.csproj b/exercises/practice/linked-list/LinkedList.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/linked-list/LinkedList.csproj +++ b/exercises/practice/linked-list/LinkedList.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/list-ops/ListOps.csproj b/exercises/practice/list-ops/ListOps.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/list-ops/ListOps.csproj +++ b/exercises/practice/list-ops/ListOps.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/luhn/Luhn.csproj b/exercises/practice/luhn/Luhn.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/luhn/Luhn.csproj +++ b/exercises/practice/luhn/Luhn.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/markdown/Markdown.csproj b/exercises/practice/markdown/Markdown.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/markdown/Markdown.csproj +++ b/exercises/practice/markdown/Markdown.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/matching-brackets/MatchingBrackets.csproj b/exercises/practice/matching-brackets/MatchingBrackets.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/matching-brackets/MatchingBrackets.csproj +++ b/exercises/practice/matching-brackets/MatchingBrackets.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/matrix/Matrix.csproj b/exercises/practice/matrix/Matrix.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/matrix/Matrix.csproj +++ b/exercises/practice/matrix/Matrix.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/meetup/Meetup.csproj b/exercises/practice/meetup/Meetup.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/meetup/Meetup.csproj +++ b/exercises/practice/meetup/Meetup.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/minesweeper/Minesweeper.csproj b/exercises/practice/minesweeper/Minesweeper.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/minesweeper/Minesweeper.csproj +++ b/exercises/practice/minesweeper/Minesweeper.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/nth-prime/NthPrime.csproj b/exercises/practice/nth-prime/NthPrime.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/nth-prime/NthPrime.csproj +++ b/exercises/practice/nth-prime/NthPrime.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/nucleotide-count/NucleotideCount.csproj b/exercises/practice/nucleotide-count/NucleotideCount.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/nucleotide-count/NucleotideCount.csproj +++ b/exercises/practice/nucleotide-count/NucleotideCount.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/ocr-numbers/OcrNumbers.csproj b/exercises/practice/ocr-numbers/OcrNumbers.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/ocr-numbers/OcrNumbers.csproj +++ b/exercises/practice/ocr-numbers/OcrNumbers.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/octal/Octal.csproj b/exercises/practice/octal/Octal.csproj index 09fcf4d6ea..5553da3b47 100644 --- a/exercises/practice/octal/Octal.csproj +++ b/exercises/practice/octal/Octal.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/palindrome-products/.articles/is-palindrome-check/code/BenchmarkIsPalindrome.csproj b/exercises/practice/palindrome-products/.articles/is-palindrome-check/code/BenchmarkIsPalindrome.csproj index 10430fd745..e22198328f 100644 --- a/exercises/practice/palindrome-products/.articles/is-palindrome-check/code/BenchmarkIsPalindrome.csproj +++ b/exercises/practice/palindrome-products/.articles/is-palindrome-check/code/BenchmarkIsPalindrome.csproj @@ -5,6 +5,7 @@ net9.0 enable enable + enable true diff --git a/exercises/practice/palindrome-products/PalindromeProducts.csproj b/exercises/practice/palindrome-products/PalindromeProducts.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/palindrome-products/PalindromeProducts.csproj +++ b/exercises/practice/palindrome-products/PalindromeProducts.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/pangram/.articles/performance/code/Benchmark_Csharp.csproj b/exercises/practice/pangram/.articles/performance/code/Benchmark_Csharp.csproj index 2ec2bf993c..3e9d5d040a 100644 --- a/exercises/practice/pangram/.articles/performance/code/Benchmark_Csharp.csproj +++ b/exercises/practice/pangram/.articles/performance/code/Benchmark_Csharp.csproj @@ -5,6 +5,7 @@ net9.0 enable enable + enable true diff --git a/exercises/practice/pangram/Pangram.csproj b/exercises/practice/pangram/Pangram.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/pangram/Pangram.csproj +++ b/exercises/practice/pangram/Pangram.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/parallel-letter-frequency/ParallelLetterFrequency.csproj b/exercises/practice/parallel-letter-frequency/ParallelLetterFrequency.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/parallel-letter-frequency/ParallelLetterFrequency.csproj +++ b/exercises/practice/parallel-letter-frequency/ParallelLetterFrequency.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/pascals-triangle/PascalsTriangle.csproj b/exercises/practice/pascals-triangle/PascalsTriangle.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/pascals-triangle/PascalsTriangle.csproj +++ b/exercises/practice/pascals-triangle/PascalsTriangle.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/perfect-numbers/PerfectNumbers.csproj b/exercises/practice/perfect-numbers/PerfectNumbers.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/perfect-numbers/PerfectNumbers.csproj +++ b/exercises/practice/perfect-numbers/PerfectNumbers.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/phone-number/PhoneNumber.csproj b/exercises/practice/phone-number/PhoneNumber.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/phone-number/PhoneNumber.csproj +++ b/exercises/practice/phone-number/PhoneNumber.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/pig-latin/PigLatin.csproj b/exercises/practice/pig-latin/PigLatin.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/pig-latin/PigLatin.csproj +++ b/exercises/practice/pig-latin/PigLatin.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/poker/Poker.csproj b/exercises/practice/poker/Poker.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/poker/Poker.csproj +++ b/exercises/practice/poker/Poker.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/pov/Pov.csproj b/exercises/practice/pov/Pov.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/pov/Pov.csproj +++ b/exercises/practice/pov/Pov.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/prime-factors/PrimeFactors.csproj b/exercises/practice/prime-factors/PrimeFactors.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/prime-factors/PrimeFactors.csproj +++ b/exercises/practice/prime-factors/PrimeFactors.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/protein-translation/.articles/performance/code/Benchmark_Csharp.csproj b/exercises/practice/protein-translation/.articles/performance/code/Benchmark_Csharp.csproj index 2ec2bf993c..3e9d5d040a 100644 --- a/exercises/practice/protein-translation/.articles/performance/code/Benchmark_Csharp.csproj +++ b/exercises/practice/protein-translation/.articles/performance/code/Benchmark_Csharp.csproj @@ -5,6 +5,7 @@ net9.0 enable enable + enable true diff --git a/exercises/practice/protein-translation/ProteinTranslation.csproj b/exercises/practice/protein-translation/ProteinTranslation.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/protein-translation/ProteinTranslation.csproj +++ b/exercises/practice/protein-translation/ProteinTranslation.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/proverb/Proverb.csproj b/exercises/practice/proverb/Proverb.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/proverb/Proverb.csproj +++ b/exercises/practice/proverb/Proverb.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/pythagorean-triplet/PythagoreanTriplet.csproj b/exercises/practice/pythagorean-triplet/PythagoreanTriplet.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/pythagorean-triplet/PythagoreanTriplet.csproj +++ b/exercises/practice/pythagorean-triplet/PythagoreanTriplet.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/queen-attack/QueenAttack.csproj b/exercises/practice/queen-attack/QueenAttack.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/queen-attack/QueenAttack.csproj +++ b/exercises/practice/queen-attack/QueenAttack.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/rail-fence-cipher/RailFenceCipher.csproj b/exercises/practice/rail-fence-cipher/RailFenceCipher.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/rail-fence-cipher/RailFenceCipher.csproj +++ b/exercises/practice/rail-fence-cipher/RailFenceCipher.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/raindrops/.articles/performance/code/Benchmark_Csharp.csproj b/exercises/practice/raindrops/.articles/performance/code/Benchmark_Csharp.csproj index 2ec2bf993c..3e9d5d040a 100644 --- a/exercises/practice/raindrops/.articles/performance/code/Benchmark_Csharp.csproj +++ b/exercises/practice/raindrops/.articles/performance/code/Benchmark_Csharp.csproj @@ -5,6 +5,7 @@ net9.0 enable enable + enable true diff --git a/exercises/practice/raindrops/Raindrops.csproj b/exercises/practice/raindrops/Raindrops.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/raindrops/Raindrops.csproj +++ b/exercises/practice/raindrops/Raindrops.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/rational-numbers/RationalNumbers.csproj b/exercises/practice/rational-numbers/RationalNumbers.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/rational-numbers/RationalNumbers.csproj +++ b/exercises/practice/rational-numbers/RationalNumbers.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/react/React.csproj b/exercises/practice/react/React.csproj index 7b04d6762a..f39ce99541 100644 --- a/exercises/practice/react/React.csproj +++ b/exercises/practice/react/React.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/rectangles/Rectangles.csproj b/exercises/practice/rectangles/Rectangles.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/rectangles/Rectangles.csproj +++ b/exercises/practice/rectangles/Rectangles.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/resistor-color-duo/ResistorColorDuo.csproj b/exercises/practice/resistor-color-duo/ResistorColorDuo.csproj index fdd0e59e0a..c0cd30d092 100644 --- a/exercises/practice/resistor-color-duo/ResistorColorDuo.csproj +++ b/exercises/practice/resistor-color-duo/ResistorColorDuo.csproj @@ -2,6 +2,7 @@ net9.0 false + enable true diff --git a/exercises/practice/resistor-color-trio/ResistorColorTrio.csproj b/exercises/practice/resistor-color-trio/ResistorColorTrio.csproj index 13329d6f93..3f97a1ab29 100644 --- a/exercises/practice/resistor-color-trio/ResistorColorTrio.csproj +++ b/exercises/practice/resistor-color-trio/ResistorColorTrio.csproj @@ -2,6 +2,7 @@ net9.0 false + enable true diff --git a/exercises/practice/resistor-color/ResistorColor.csproj b/exercises/practice/resistor-color/ResistorColor.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/resistor-color/ResistorColor.csproj +++ b/exercises/practice/resistor-color/ResistorColor.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/rest-api/RestApi.csproj b/exercises/practice/rest-api/RestApi.csproj index 53f95ed2a5..7625d0c3c3 100644 --- a/exercises/practice/rest-api/RestApi.csproj +++ b/exercises/practice/rest-api/RestApi.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/reverse-string/.articles/performance/code/Benchmark.csproj b/exercises/practice/reverse-string/.articles/performance/code/Benchmark.csproj index 7b80668784..b2010410cd 100644 --- a/exercises/practice/reverse-string/.articles/performance/code/Benchmark.csproj +++ b/exercises/practice/reverse-string/.articles/performance/code/Benchmark.csproj @@ -6,6 +6,7 @@ enable enable Performance + enable true diff --git a/exercises/practice/reverse-string/ReverseString.csproj b/exercises/practice/reverse-string/ReverseString.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/reverse-string/ReverseString.csproj +++ b/exercises/practice/reverse-string/ReverseString.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/rna-transcription/RnaTranscription.csproj b/exercises/practice/rna-transcription/RnaTranscription.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/rna-transcription/RnaTranscription.csproj +++ b/exercises/practice/rna-transcription/RnaTranscription.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/robot-name/RobotName.csproj b/exercises/practice/robot-name/RobotName.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/robot-name/RobotName.csproj +++ b/exercises/practice/robot-name/RobotName.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/robot-simulator/RobotSimulator.csproj b/exercises/practice/robot-simulator/RobotSimulator.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/robot-simulator/RobotSimulator.csproj +++ b/exercises/practice/robot-simulator/RobotSimulator.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/roman-numerals/RomanNumerals.csproj b/exercises/practice/roman-numerals/RomanNumerals.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/roman-numerals/RomanNumerals.csproj +++ b/exercises/practice/roman-numerals/RomanNumerals.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/rotational-cipher/RotationalCipher.csproj b/exercises/practice/rotational-cipher/RotationalCipher.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/rotational-cipher/RotationalCipher.csproj +++ b/exercises/practice/rotational-cipher/RotationalCipher.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/run-length-encoding/RunLengthEncoding.csproj b/exercises/practice/run-length-encoding/RunLengthEncoding.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/run-length-encoding/RunLengthEncoding.csproj +++ b/exercises/practice/run-length-encoding/RunLengthEncoding.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/saddle-points/SaddlePoints.csproj b/exercises/practice/saddle-points/SaddlePoints.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/saddle-points/SaddlePoints.csproj +++ b/exercises/practice/saddle-points/SaddlePoints.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/satellite/Satellite.csproj b/exercises/practice/satellite/Satellite.csproj index bffca349b9..8c2df9cd7e 100644 --- a/exercises/practice/satellite/Satellite.csproj +++ b/exercises/practice/satellite/Satellite.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/say/Say.csproj b/exercises/practice/say/Say.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/say/Say.csproj +++ b/exercises/practice/say/Say.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/scale-generator/ScaleGenerator.csproj b/exercises/practice/scale-generator/ScaleGenerator.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/scale-generator/ScaleGenerator.csproj +++ b/exercises/practice/scale-generator/ScaleGenerator.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/scrabble-score/ScrabbleScore.csproj b/exercises/practice/scrabble-score/ScrabbleScore.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/scrabble-score/ScrabbleScore.csproj +++ b/exercises/practice/scrabble-score/ScrabbleScore.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/secret-handshake/SecretHandshake.csproj b/exercises/practice/secret-handshake/SecretHandshake.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/secret-handshake/SecretHandshake.csproj +++ b/exercises/practice/secret-handshake/SecretHandshake.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/series/Series.csproj b/exercises/practice/series/Series.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/series/Series.csproj +++ b/exercises/practice/series/Series.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/sgf-parsing/SgfParsing.csproj b/exercises/practice/sgf-parsing/SgfParsing.csproj index b50f77bd07..b0d0bd802a 100644 --- a/exercises/practice/sgf-parsing/SgfParsing.csproj +++ b/exercises/practice/sgf-parsing/SgfParsing.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/sieve/.articles/performance/code/Benchmark.csproj b/exercises/practice/sieve/.articles/performance/code/Benchmark.csproj index 2ec2bf993c..3e9d5d040a 100644 --- a/exercises/practice/sieve/.articles/performance/code/Benchmark.csproj +++ b/exercises/practice/sieve/.articles/performance/code/Benchmark.csproj @@ -5,6 +5,7 @@ net9.0 enable enable + enable true diff --git a/exercises/practice/sieve/Sieve.csproj b/exercises/practice/sieve/Sieve.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/sieve/Sieve.csproj +++ b/exercises/practice/sieve/Sieve.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/simple-cipher/SimpleCipher.csproj b/exercises/practice/simple-cipher/SimpleCipher.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/simple-cipher/SimpleCipher.csproj +++ b/exercises/practice/simple-cipher/SimpleCipher.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/simple-linked-list/SimpleLinkedList.csproj b/exercises/practice/simple-linked-list/SimpleLinkedList.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/simple-linked-list/SimpleLinkedList.csproj +++ b/exercises/practice/simple-linked-list/SimpleLinkedList.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/space-age/SpaceAge.csproj b/exercises/practice/space-age/SpaceAge.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/space-age/SpaceAge.csproj +++ b/exercises/practice/space-age/SpaceAge.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/spiral-matrix/SpiralMatrix.csproj b/exercises/practice/spiral-matrix/SpiralMatrix.csproj index 53f95ed2a5..7625d0c3c3 100644 --- a/exercises/practice/spiral-matrix/SpiralMatrix.csproj +++ b/exercises/practice/spiral-matrix/SpiralMatrix.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/square-root/SquareRoot.csproj b/exercises/practice/square-root/SquareRoot.csproj index 3214d97dc0..8b9b0b9c05 100644 --- a/exercises/practice/square-root/SquareRoot.csproj +++ b/exercises/practice/square-root/SquareRoot.csproj @@ -7,6 +7,7 @@ false true + enable true diff --git a/exercises/practice/state-of-tic-tac-toe/StateOfTicTacToe.csproj b/exercises/practice/state-of-tic-tac-toe/StateOfTicTacToe.csproj index 0633067747..b1f643db51 100644 --- a/exercises/practice/state-of-tic-tac-toe/StateOfTicTacToe.csproj +++ b/exercises/practice/state-of-tic-tac-toe/StateOfTicTacToe.csproj @@ -2,6 +2,7 @@ net9.0 false + enable true diff --git a/exercises/practice/strain/Strain.csproj b/exercises/practice/strain/Strain.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/strain/Strain.csproj +++ b/exercises/practice/strain/Strain.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/sublist/Sublist.csproj b/exercises/practice/sublist/Sublist.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/sublist/Sublist.csproj +++ b/exercises/practice/sublist/Sublist.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/sum-of-multiples/SumOfMultiples.csproj b/exercises/practice/sum-of-multiples/SumOfMultiples.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/sum-of-multiples/SumOfMultiples.csproj +++ b/exercises/practice/sum-of-multiples/SumOfMultiples.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/tournament/Tournament.csproj b/exercises/practice/tournament/Tournament.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/tournament/Tournament.csproj +++ b/exercises/practice/tournament/Tournament.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/transpose/Transpose.csproj b/exercises/practice/transpose/Transpose.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/transpose/Transpose.csproj +++ b/exercises/practice/transpose/Transpose.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/tree-building/TreeBuilding.csproj b/exercises/practice/tree-building/TreeBuilding.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/tree-building/TreeBuilding.csproj +++ b/exercises/practice/tree-building/TreeBuilding.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/triangle/Triangle.csproj b/exercises/practice/triangle/Triangle.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/triangle/Triangle.csproj +++ b/exercises/practice/triangle/Triangle.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/trinary/Trinary.csproj b/exercises/practice/trinary/Trinary.csproj index 09fcf4d6ea..5553da3b47 100644 --- a/exercises/practice/trinary/Trinary.csproj +++ b/exercises/practice/trinary/Trinary.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/twelve-days/TwelveDays.csproj b/exercises/practice/twelve-days/TwelveDays.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/twelve-days/TwelveDays.csproj +++ b/exercises/practice/twelve-days/TwelveDays.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/two-bucket/TwoBucket.csproj b/exercises/practice/two-bucket/TwoBucket.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/two-bucket/TwoBucket.csproj +++ b/exercises/practice/two-bucket/TwoBucket.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/two-fer/TwoFer.csproj b/exercises/practice/two-fer/TwoFer.csproj index 53f95ed2a5..7625d0c3c3 100644 --- a/exercises/practice/two-fer/TwoFer.csproj +++ b/exercises/practice/two-fer/TwoFer.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/variable-length-quantity/VariableLengthQuantity.csproj b/exercises/practice/variable-length-quantity/VariableLengthQuantity.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/variable-length-quantity/VariableLengthQuantity.csproj +++ b/exercises/practice/variable-length-quantity/VariableLengthQuantity.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/word-count/WordCount.csproj b/exercises/practice/word-count/WordCount.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/word-count/WordCount.csproj +++ b/exercises/practice/word-count/WordCount.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/word-search/WordSearch.csproj b/exercises/practice/word-search/WordSearch.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/word-search/WordSearch.csproj +++ b/exercises/practice/word-search/WordSearch.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/wordy/Wordy.csproj b/exercises/practice/wordy/Wordy.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/wordy/Wordy.csproj +++ b/exercises/practice/wordy/Wordy.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/yacht/Yacht.csproj b/exercises/practice/yacht/Yacht.csproj index be6641331a..f569a59854 100644 --- a/exercises/practice/yacht/Yacht.csproj +++ b/exercises/practice/yacht/Yacht.csproj @@ -3,6 +3,7 @@ Exe net9.0 + enable true diff --git a/exercises/practice/zebra-puzzle/ZebraPuzzle.csproj b/exercises/practice/zebra-puzzle/ZebraPuzzle.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/zebra-puzzle/ZebraPuzzle.csproj +++ b/exercises/practice/zebra-puzzle/ZebraPuzzle.csproj @@ -2,6 +2,7 @@ net9.0 + enable true diff --git a/exercises/practice/zipper/Zipper.csproj b/exercises/practice/zipper/Zipper.csproj index 06c91ac7a6..590e2b629e 100644 --- a/exercises/practice/zipper/Zipper.csproj +++ b/exercises/practice/zipper/Zipper.csproj @@ -2,6 +2,7 @@ net9.0 + enable true From 160d446e8e87af84859756fa88506c41ef8357b2 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Mon, 17 Feb 2025 18:41:57 +0100 Subject: [PATCH 02/32] Several nullable fixes --- .../flatten-array/.meta/Generator.tpl | 10 ++--- .../flatten-array/FlattenArrayTests.cs | 42 +++++++++---------- exercises/practice/rest-api/RestApi.cs | 2 +- exercises/practice/satellite/Satellite.cs | 2 +- .../state-of-tic-tac-toe/StateOfTicTacToe.cs | 7 +++- exercises/practice/zipper/Zipper.cs | 16 +++---- 6 files changed, 42 insertions(+), 37 deletions(-) diff --git a/exercises/practice/flatten-array/.meta/Generator.tpl b/exercises/practice/flatten-array/.meta/Generator.tpl index 02583b06b7..e300303183 100644 --- a/exercises/practice/flatten-array/.meta/Generator.tpl +++ b/exercises/practice/flatten-array/.meta/Generator.tpl @@ -2,10 +2,10 @@ case (object.typeof input) when "array" if input.empty? - ret "Array.Empty()" + ret "Array.Empty()" else elements = array.join (array.each input @toarg) ", " - ret "new object[] { " + elements + " }" + ret "new object?[] { " + elements + " }" end else if input @@ -26,11 +26,11 @@ public class {{ testClass }} public void {{ test.testMethod }}() { {{- if test.input.array.empty? }} - var array = Array.Empty(); + var array = Array.Empty(); Assert.Empty({{ testedClass }}.{{ test.testedMethod }}(array)); {{- else }} - object[] array = {{ test.input.array | toarg }}; - object[] expected = {{ test.expected }}; + object?[] array = {{ test.input.array | toarg }}; + object?[] expected = {{ test.expected }}; Assert.Equal(expected, {{ testedClass }}.{{ test.testedMethod }}(array)); {{ end -}} } diff --git a/exercises/practice/flatten-array/FlattenArrayTests.cs b/exercises/practice/flatten-array/FlattenArrayTests.cs index 51a1c03241..64ea0ede4c 100644 --- a/exercises/practice/flatten-array/FlattenArrayTests.cs +++ b/exercises/practice/flatten-array/FlattenArrayTests.cs @@ -6,87 +6,87 @@ public class FlattenArrayTests [Fact] public void Empty() { - var array = Array.Empty(); + var array = Array.Empty(); Assert.Empty(FlattenArray.Flatten(array)); } [Fact(Skip = "Remove this Skip property to run this test")] public void No_nesting() { - object[] array = new object[] { 0, 1, 2 }; - object[] expected = [0, 1, 2]; + object?[] array = new object?[] { 0, 1, 2 }; + object?[] expected = [0, 1, 2]; Assert.Equal(expected, FlattenArray.Flatten(array)); } [Fact(Skip = "Remove this Skip property to run this test")] public void Flattens_a_nested_array() { - object[] array = new object[] { new object[] { Array.Empty() } }; - object[] expected = []; + object?[] array = new object?[] { new object?[] { Array.Empty() } }; + object?[] expected = []; Assert.Equal(expected, FlattenArray.Flatten(array)); } [Fact(Skip = "Remove this Skip property to run this test")] public void Flattens_array_with_just_integers_present() { - object[] array = new object[] { 1, new object[] { 2, 3, 4, 5, 6, 7 }, 8 }; - object[] expected = [1, 2, 3, 4, 5, 6, 7, 8]; + object?[] array = new object?[] { 1, new object?[] { 2, 3, 4, 5, 6, 7 }, 8 }; + object?[] expected = [1, 2, 3, 4, 5, 6, 7, 8]; Assert.Equal(expected, FlattenArray.Flatten(array)); } [Fact(Skip = "Remove this Skip property to run this test")] public void Five_level_nesting() { - object[] array = new object[] { 0, 2, new object[] { new object[] { 2, 3 }, 8, 100, 4, new object[] { new object[] { new object[] { 50 } } } }, -2 }; - object[] expected = [0, 2, 2, 3, 8, 100, 4, 50, -2]; + object?[] array = new object?[] { 0, 2, new object?[] { new object?[] { 2, 3 }, 8, 100, 4, new object?[] { new object?[] { new object?[] { 50 } } } }, -2 }; + object?[] expected = [0, 2, 2, 3, 8, 100, 4, 50, -2]; Assert.Equal(expected, FlattenArray.Flatten(array)); } [Fact(Skip = "Remove this Skip property to run this test")] public void Six_level_nesting() { - object[] array = new object[] { 1, new object[] { 2, new object[] { new object[] { 3 } }, new object[] { 4, new object[] { new object[] { 5 } } }, 6, 7 }, 8 }; - object[] expected = [1, 2, 3, 4, 5, 6, 7, 8]; + object?[] array = new object?[] { 1, new object?[] { 2, new object?[] { new object?[] { 3 } }, new object?[] { 4, new object?[] { new object?[] { 5 } } }, 6, 7 }, 8 }; + object?[] expected = [1, 2, 3, 4, 5, 6, 7, 8]; Assert.Equal(expected, FlattenArray.Flatten(array)); } [Fact(Skip = "Remove this Skip property to run this test")] public void Null_values_are_omitted_from_the_final_result() { - object[] array = new object[] { 1, 2, null }; - object[] expected = [1, 2]; + object?[] array = new object?[] { 1, 2, null }; + object?[] expected = [1, 2]; Assert.Equal(expected, FlattenArray.Flatten(array)); } [Fact(Skip = "Remove this Skip property to run this test")] public void Consecutive_null_values_at_the_front_of_the_list_are_omitted_from_the_final_result() { - object[] array = new object[] { null, null, 3 }; - object[] expected = [3]; + object?[] array = new object?[] { null, null, 3 }; + object?[] expected = [3]; Assert.Equal(expected, FlattenArray.Flatten(array)); } [Fact(Skip = "Remove this Skip property to run this test")] public void Consecutive_null_values_in_the_middle_of_the_list_are_omitted_from_the_final_result() { - object[] array = new object[] { 1, null, null, 4 }; - object[] expected = [1, 4]; + object?[] array = new object?[] { 1, null, null, 4 }; + object?[] expected = [1, 4]; Assert.Equal(expected, FlattenArray.Flatten(array)); } [Fact(Skip = "Remove this Skip property to run this test")] public void Six_level_nest_list_with_null_values() { - object[] array = new object[] { 0, 2, new object[] { new object[] { 2, 3 }, 8, new object[] { new object[] { 100 } }, null, new object[] { new object[] { null } } }, -2 }; - object[] expected = [0, 2, 2, 3, 8, 100, -2]; + object?[] array = new object?[] { 0, 2, new object?[] { new object?[] { 2, 3 }, 8, new object?[] { new object?[] { 100 } }, null, new object?[] { new object?[] { null } } }, -2 }; + object?[] expected = [0, 2, 2, 3, 8, 100, -2]; Assert.Equal(expected, FlattenArray.Flatten(array)); } [Fact(Skip = "Remove this Skip property to run this test")] public void All_values_in_nested_list_are_null() { - object[] array = new object[] { null, new object[] { new object[] { new object[] { null } } }, null, null, new object[] { new object[] { null, null }, null }, null }; - object[] expected = []; + object?[] array = new object?[] { null, new object?[] { new object?[] { new object?[] { null } } }, null, null, new object?[] { new object?[] { null, null }, null }, null }; + object?[] expected = []; Assert.Equal(expected, FlattenArray.Flatten(array)); } } diff --git a/exercises/practice/rest-api/RestApi.cs b/exercises/practice/rest-api/RestApi.cs index 34403d207c..6d86f608b2 100644 --- a/exercises/practice/rest-api/RestApi.cs +++ b/exercises/practice/rest-api/RestApi.cs @@ -7,7 +7,7 @@ public RestApi(string database) throw new NotImplementedException("You need to implement this method."); } - public string Get(string url, string payload = null) + public string Get(string url, string? payload = null) { throw new NotImplementedException("You need to implement this method."); } diff --git a/exercises/practice/satellite/Satellite.cs b/exercises/practice/satellite/Satellite.cs index 1015c99f74..bcad75267c 100644 --- a/exercises/practice/satellite/Satellite.cs +++ b/exercises/practice/satellite/Satellite.cs @@ -1,6 +1,6 @@ using System; -public record Tree(char Value, Tree Left, Tree Right); +public record Tree(char Value, Tree? Left, Tree? Right); public static class Satellite { diff --git a/exercises/practice/state-of-tic-tac-toe/StateOfTicTacToe.cs b/exercises/practice/state-of-tic-tac-toe/StateOfTicTacToe.cs index 84169e52c4..f4cb9e1ef3 100644 --- a/exercises/practice/state-of-tic-tac-toe/StateOfTicTacToe.cs +++ b/exercises/practice/state-of-tic-tac-toe/StateOfTicTacToe.cs @@ -8,8 +8,13 @@ public enum State Invalid } -public class TicTacToe(string[] rows) +public class TicTacToe { + public TicTacToe(string[] rows) + { + throw new NotImplementedException("Please implement this constructor"); + } + public State State { get diff --git a/exercises/practice/zipper/Zipper.cs b/exercises/practice/zipper/Zipper.cs index 29b063cb95..b0edd015ae 100644 --- a/exercises/practice/zipper/Zipper.cs +++ b/exercises/practice/zipper/Zipper.cs @@ -2,14 +2,14 @@ public class BinTree { - public BinTree(int value, BinTree left, BinTree right) + public BinTree(int value, BinTree? left, BinTree? right) { throw new NotImplementedException("You need to implement this method."); } public int Value { get; } - public BinTree Left { get; } - public BinTree Right { get; } + public BinTree? Left { get; } + public BinTree? Right { get; } } public class Zipper @@ -24,27 +24,27 @@ public Zipper SetValue(int newValue) throw new NotImplementedException("You need to implement this method."); } - public Zipper SetLeft(BinTree binTree) + public Zipper SetLeft(BinTree? binTree) { throw new NotImplementedException("You need to implement this method."); } - public Zipper SetRight(BinTree binTree) + public Zipper SetRight(BinTree? binTree) { throw new NotImplementedException("You need to implement this method."); } - public Zipper Left() + public Zipper? Left() { throw new NotImplementedException("You need to implement this method."); } - public Zipper Right() + public Zipper? Right() { throw new NotImplementedException("You need to implement this method."); } - public Zipper Up() + public Zipper? Up() { throw new NotImplementedException("You need to implement this method."); } From 7224d7417dd611419cfa3b37f75b714b1de8a7ec Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Mon, 17 Feb 2025 18:51:37 +0100 Subject: [PATCH 03/32] Fix dot-dsl --- exercises/practice/dot-dsl/.meta/Example.cs | 6 ++--- exercises/practice/dot-dsl/DotDslTests.cs | 30 +++++++-------------- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/exercises/practice/dot-dsl/.meta/Example.cs b/exercises/practice/dot-dsl/.meta/Example.cs index 80723f973a..907f4b4f3d 100644 --- a/exercises/practice/dot-dsl/.meta/Example.cs +++ b/exercises/practice/dot-dsl/.meta/Example.cs @@ -10,7 +10,7 @@ public Node(string name) public string Name { get; } - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj == null || GetType() != obj.GetType()) return false; @@ -32,7 +32,7 @@ public Edge(string node1, string node2) public string Node1 { get; } public string Node2 { get; } - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj == null || GetType() != obj.GetType()) return false; @@ -55,7 +55,7 @@ public Attr(string key, string value) public string Key { get; } public string Value { get; } - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (obj == null || GetType() != obj.GetType()) return false; diff --git a/exercises/practice/dot-dsl/DotDslTests.cs b/exercises/practice/dot-dsl/DotDslTests.cs index 40adfcd09b..225e25324a 100644 --- a/exercises/practice/dot-dsl/DotDslTests.cs +++ b/exercises/practice/dot-dsl/DotDslTests.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Linq; using Xunit; @@ -23,7 +22,7 @@ public void Graph_with_one_node() new Node("a") }; - Assert.Equal(new[] { new Node("a") }, g.Nodes); + Assert.Equal([new Node("a")], g.Nodes); Assert.Empty(g.Edges); Assert.Empty(g.Attrs); } @@ -36,7 +35,7 @@ public void Graph_with_one_node_with_keywords() new Node("a") { { "color", "green" } } }; - Assert.Equal(new[] { new Node("a") { { "color", "green" } } }, g.Nodes); + Assert.Equal([new Node("a") { { "color", "green" } }], g.Nodes); Assert.Empty(g.Edges); Assert.Empty(g.Attrs); } @@ -50,7 +49,7 @@ public void Graph_with_one_edge() }; Assert.Empty(g.Nodes); - Assert.Equal(new[] { new Edge("a", "b") }, g.Edges); + Assert.Equal([new Edge("a", "b")], g.Edges); Assert.Empty(g.Attrs); } @@ -64,7 +63,7 @@ public void Graph_with_one_attribute() Assert.Empty(g.Nodes); Assert.Empty(g.Edges); - Assert.Equal(new[] { new Attr("foo", "1") }, g.Attrs); + Assert.Equal([new Attr("foo", "1")], g.Attrs); } [Fact(Skip = "Remove this Skip property to run this test")] @@ -82,20 +81,11 @@ public void Graph_with_attributes() { "bar", "true" } }; - Assert.Equal(new[] { new Node("a") { { "color", "green" } }, new Node("b") { { "label", "Beta!" } }, new Node("c") }, g.Nodes, EnumerableEqualityComparer.Instance); - Assert.Equal(new[] { new Edge("a", "b") { { "color", "blue" } }, new Edge("b", "c") }, g.Edges, EnumerableEqualityComparer.Instance); - Assert.Equal(new[] { new Attr("bar", "true"), new Attr("foo", "1"), new Attr("title", "Testing Attrs") }, g.Attrs, EnumerableEqualityComparer.Instance); - } - - private class EnumerableEqualityComparer : IEqualityComparer> - { - public static readonly EnumerableEqualityComparer Instance = new EnumerableEqualityComparer(); - - public bool Equals(IEnumerable x, IEnumerable y) => new HashSet(x).SetEquals(y); - - public int GetHashCode(IEnumerable obj) - { - throw new NotImplementedException("You need to implement this method."); - } + HashSet expectedNodes = [new Node("a") { { "color", "green" } }, new Node("b") { { "label", "Beta!" } }, new Node("c")]; + Assert.Equal(expectedNodes, g.Nodes.ToHashSet()); + HashSet expectedEdges = [new Edge("a", "b") { { "color", "blue" } }, new Edge("b", "c")]; + Assert.Equal(expectedEdges, g.Edges.ToHashSet()); + HashSet expectedAttrs = [new Attr("bar", "true"), new Attr("foo", "1"), new Attr("title", "Testing Attrs")]; + Assert.Equal(expectedAttrs, g.Attrs.ToHashSet()); } } \ No newline at end of file From 2f23d26d2529c8a97f9897d6d7b86c1a2fb47b69 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 11:47:37 +0100 Subject: [PATCH 04/32] calculator-conundrum: fix nullable --- exercises/concept/calculator-conundrum/.meta/Exemplar.cs | 2 +- exercises/concept/calculator-conundrum/CalculatorConundrum.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/concept/calculator-conundrum/.meta/Exemplar.cs b/exercises/concept/calculator-conundrum/.meta/Exemplar.cs index 405c4c727d..3253044514 100644 --- a/exercises/concept/calculator-conundrum/.meta/Exemplar.cs +++ b/exercises/concept/calculator-conundrum/.meta/Exemplar.cs @@ -2,7 +2,7 @@ public static class SimpleCalculator { - public static string Calculate(int operand1, int operand2, string operation) + public static string Calculate(int operand1, int operand2, string? operation) { int result; try diff --git a/exercises/concept/calculator-conundrum/CalculatorConundrum.cs b/exercises/concept/calculator-conundrum/CalculatorConundrum.cs index fc87406a43..e56ac5ca8a 100644 --- a/exercises/concept/calculator-conundrum/CalculatorConundrum.cs +++ b/exercises/concept/calculator-conundrum/CalculatorConundrum.cs @@ -2,7 +2,7 @@ public static class SimpleCalculator { - public static string Calculate(int operand1, int operand2, string operation) + public static string Calculate(int operand1, int operand2, string? operation) { throw new NotImplementedException("Please implement the SimpleCalculator.Calculate() method"); } From 49a7836942988fdea61c6bf5dadf56822fa21b50 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 11:50:25 +0100 Subject: [PATCH 05/32] developer-privileges: fix nullable --- .../concept/developer-privileges/.meta/Exemplar.cs | 10 +++++----- .../developer-privileges/DeveloperPrivileges.cs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/exercises/concept/developer-privileges/.meta/Exemplar.cs b/exercises/concept/developer-privileges/.meta/Exemplar.cs index d53799069f..9a4a58d725 100644 --- a/exercises/concept/developer-privileges/.meta/Exemplar.cs +++ b/exercises/concept/developer-privileges/.meta/Exemplar.cs @@ -44,14 +44,14 @@ public class Authenticator //**** please do not modify the FacialFeatures class **** public class FacialFeatures { - public string EyeColor { get; set; } - public decimal PhiltrumWidth { get; set; } + public required string EyeColor { get; set; } + public required decimal PhiltrumWidth { get; set; } } //**** please do not modify the Identity class **** public class Identity { - public string Email { get; set; } - public FacialFeatures FacialFeatures { get; set; } - public IList NameAndAddress { get; set; } + public required string Email { get; set; } + public required FacialFeatures FacialFeatures { get; set; } + public required IList NameAndAddress { get; set; } } diff --git a/exercises/concept/developer-privileges/DeveloperPrivileges.cs b/exercises/concept/developer-privileges/DeveloperPrivileges.cs index eaf6906e35..76e431764d 100644 --- a/exercises/concept/developer-privileges/DeveloperPrivileges.cs +++ b/exercises/concept/developer-privileges/DeveloperPrivileges.cs @@ -13,14 +13,14 @@ public class Authenticator //**** please do not modify the FacialFeatures class **** public class FacialFeatures { - public string EyeColor { get; set; } - public decimal PhiltrumWidth { get; set; } + public required string EyeColor { get; set; } + public required decimal PhiltrumWidth { get; set; } } //**** please do not modify the Identity class **** public class Identity { - public string Email { get; set; } - public FacialFeatures FacialFeatures { get; set; } - public IList NameAndAddress { get; set; } + public required string Email { get; set; } + public required FacialFeatures FacialFeatures { get; set; } + public required IList NameAndAddress { get; set; } } From 8fffdd5d5c591ed846e2a440688f4c605f49b009 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 12:05:52 +0100 Subject: [PATCH 06/32] face-id2: fix --- exercises/concept/faceid-2/.meta/Exemplar.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/concept/faceid-2/.meta/Exemplar.cs b/exercises/concept/faceid-2/.meta/Exemplar.cs index 20c143543e..e21b101d2c 100644 --- a/exercises/concept/faceid-2/.meta/Exemplar.cs +++ b/exercises/concept/faceid-2/.meta/Exemplar.cs @@ -17,7 +17,7 @@ protected bool Equals(FacialFeatures other) return EyeColor == other.EyeColor && PhiltrumWidth.Equals(other.PhiltrumWidth); } - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; @@ -47,7 +47,7 @@ protected bool Equals(Identity other) return Email == other.Email && Equals(FacialFeatures, other.FacialFeatures); } - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; From 4e9b1266d6073904b50f1cf8a4536decf0b21a62 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 12:08:11 +0100 Subject: [PATCH 07/32] zebra-puzzle: fix --- exercises/practice/zebra-puzzle/.meta/Example.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/practice/zebra-puzzle/.meta/Example.cs b/exercises/practice/zebra-puzzle/.meta/Example.cs index 9ea564de7e..1e87e0b139 100644 --- a/exercises/practice/zebra-puzzle/.meta/Example.cs +++ b/exercises/practice/zebra-puzzle/.meta/Example.cs @@ -108,11 +108,11 @@ public static Nationality OwnsZebra() return solution.Nationalities[Array.IndexOf(solution.Pets, Pet.Zebra)]; } - private static bool IsIndexMatch(T1[] values1, T1 value1, T2[] values2, T2 value2) => values2[Array.IndexOf(values1, value1)].Equals(value2); + private static bool IsIndexMatch(T1[] values1, T1 value1, T2[] values2, T2 value2) => values2[Array.IndexOf(values1, value1)]!.Equals(value2); private static bool IsAdjacentMatch(T1[] values1, T1 value1, T2[] values2, T2 value2) { var index = Array.IndexOf(values1, value1); - return (index > 0 && values2[index - 1].Equals(value2)) || (index < values2.Length - 1 && values2[index + 1].Equals(value2)); + return (index > 0 && values2[index - 1]!.Equals(value2)) || (index < values2.Length - 1 && values2[index + 1]!.Equals(value2)); } } \ No newline at end of file From a8c3725423bdc00a83130d59693b8f768e65612d Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 12:15:32 +0100 Subject: [PATCH 08/32] pov: fix --- exercises/practice/pov/.meta/Example.cs | 38 ++++++++++++++++--------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/exercises/practice/pov/.meta/Example.cs b/exercises/practice/pov/.meta/Example.cs index 4a2f612f92..5c0cabf91d 100644 --- a/exercises/practice/pov/.meta/Example.cs +++ b/exercises/practice/pov/.meta/Example.cs @@ -10,9 +10,14 @@ public Tree(string value, params Tree[] children) public string Value { get; } public Tree[] Children { get; } - public bool Equals(Tree other) - => Value.Equals(other.Value) && + public bool Equals(Tree? other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return Value.Equals(other.Value) && Children.OrderBy(child => child.Value).SequenceEqual(other.Children.OrderBy(child => child.Value)); + } } public class TreeCrumb @@ -38,23 +43,31 @@ public static class Pov { public static Tree FromPov(Tree graph, string value) { - var zipper = FindNode(value, GraphToZipper(graph)); + var zipper = GraphToZipper(graph); if (zipper == null) throw new ArgumentException(); + + var node = FindNode(value, zipper); + if (node == null) + throw new ArgumentException(); - return ChangeParent(zipper); + return ChangeParent(node); } public static IEnumerable PathTo(string value1, string value2, Tree graph) { - var zipper = FindNode(value2, GraphToZipper(FromPov(graph, value1))); + var zipper = GraphToZipper(FromPov(graph, value1)); if (zipper == null) throw new ArgumentException(); - return ZipperToPath(zipper); + var node = FindNode(value2, zipper); + if (node == null) + throw new ArgumentException(); + + return ZipperToPath(node); } - private static TreeZipper GraphToZipper(Tree graph) + private static TreeZipper? GraphToZipper(Tree graph) { if (graph == null) return null; @@ -64,10 +77,10 @@ private static TreeZipper GraphToZipper(Tree graph) private static IEnumerable ZipperToPath(TreeZipper zipper) { - return zipper?.Crumbs.Select(c => c.Value).Reverse().Concat(new[] { zipper.Focus.Value }); + return zipper.Crumbs.Select(c => c.Value).Reverse().Concat(new[] { zipper.Focus.Value }); } - private static TreeZipper GoDown(TreeZipper zipper) + private static TreeZipper? GoDown(TreeZipper zipper) { if (zipper == null || !zipper.Focus.Children.Any()) return null; @@ -80,7 +93,7 @@ private static TreeZipper GoDown(TreeZipper zipper) return new TreeZipper(children.First(), new[] { newCrumb }.Concat(zipper.Crumbs)); } - private static TreeZipper GoRight(TreeZipper zipper) + private static TreeZipper? GoRight(TreeZipper zipper) { if (zipper == null || !zipper.Crumbs.Any() || !zipper.Crumbs.First().Right.Any()) return null; @@ -93,7 +106,7 @@ private static TreeZipper GoRight(TreeZipper zipper) return new TreeZipper(firstCrumb.Right.First(), new[] { newCrumb }.Concat(crumbs.Skip(1))); } - private static TreeZipper FindNode(string value, TreeZipper zipper) + private static TreeZipper? FindNode(string value, TreeZipper? zipper) { if (zipper == null || zipper.Focus.Value.CompareTo(value) == 0) return zipper; @@ -103,9 +116,6 @@ private static TreeZipper FindNode(string value, TreeZipper zipper) private static Tree ChangeParent(TreeZipper zipper) { - if (zipper == null) - return null; - if (!zipper.Crumbs.Any()) return zipper.Focus; From 67e7a9690d322394d704e79f1a06b2d9126e77dc Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 15:00:44 +0100 Subject: [PATCH 09/32] zipper: fix --- exercises/practice/zipper/.meta/Example.cs | 34 +++++++++---------- exercises/practice/zipper/.meta/Generator.tpl | 2 +- exercises/practice/zipper/ZipperTests.cs | 30 ++++++++-------- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/exercises/practice/zipper/.meta/Example.cs b/exercises/practice/zipper/.meta/Example.cs index f3451371b9..019c863b76 100644 --- a/exercises/practice/zipper/.meta/Example.cs +++ b/exercises/practice/zipper/.meta/Example.cs @@ -4,7 +4,7 @@ public class BinTree : IEquatable { - public BinTree(int value, BinTree left, BinTree right) + public BinTree(int value, BinTree? left, BinTree? right) { Value = value; Left = left; @@ -16,10 +16,10 @@ public BinTree(BinTree tree) : this(tree.Value, tree.Left, tree.Right) } public int Value { get; } - public BinTree Left { get; } - public BinTree Right { get; } + public BinTree? Left { get; } + public BinTree? Right { get; } - public bool Equals(BinTree other) + public bool Equals(BinTree? other) { if (other == null || !Equals(Value, other.Value)) return false; @@ -36,26 +36,26 @@ public bool Equals(BinTree other) public abstract class BinTreeCrumb { - public BinTreeCrumb(int value, BinTree tree) + public BinTreeCrumb(int value, BinTree? tree) { Value = value; Tree = tree; } public int Value { get; } - public BinTree Tree { get; } + public BinTree? Tree { get; } } public class BinTreeLeftCrumb : BinTreeCrumb { - public BinTreeLeftCrumb(int value, BinTree tree) : base(value, tree) + public BinTreeLeftCrumb(int value, BinTree? tree) : base(value, tree) { } } public class BinTreeRightCrumb : BinTreeCrumb { - public BinTreeRightCrumb(int value, BinTree tree) : base(value, tree) + public BinTreeRightCrumb(int value, BinTree? tree) : base(value, tree) { } } @@ -63,11 +63,11 @@ public BinTreeRightCrumb(int value, BinTree tree) : base(value, tree) public class Zipper : IEquatable { private readonly int value; - private readonly BinTree left; - private readonly BinTree right; + private readonly BinTree? left; + private readonly BinTree? right; private readonly List crumbs; - public Zipper(int value, BinTree left, BinTree right, List crumbs) + public Zipper(int value, BinTree? left, BinTree? right, List crumbs) { this.value = value; this.left = left; @@ -79,11 +79,11 @@ public Zipper(int value, BinTree left, BinTree right, List crumbs) public Zipper SetValue(int newValue) => new Zipper(newValue, left, right, crumbs); - public Zipper SetLeft(BinTree binTree) => new Zipper(value, binTree, right, crumbs); + public Zipper SetLeft(BinTree? binTree) => new Zipper(value, binTree, right, crumbs); - public Zipper SetRight(BinTree binTree) => new Zipper(value, left, binTree, crumbs); + public Zipper SetRight(BinTree? binTree) => new Zipper(value, left, binTree, crumbs); - public Zipper Left() + public Zipper? Left() { if (left == null) return null; @@ -92,7 +92,7 @@ public Zipper Left() return new Zipper(left.Value, left.Left, left.Right, newCrumbs); } - public Zipper Right() + public Zipper? Right() { if (right == null) return null; @@ -101,7 +101,7 @@ public Zipper Right() return new Zipper(right.Value, right.Left, right.Right, newCrumbs); } - public Zipper Up() + public Zipper? Up() { if (crumbs.Count == 0) return null; @@ -133,7 +133,7 @@ public BinTree ToTree() return tree; } - public bool Equals(Zipper other) + public bool Equals(Zipper? other) { if (other == null) return false; diff --git a/exercises/practice/zipper/.meta/Generator.tpl b/exercises/practice/zipper/.meta/Generator.tpl index 86c262085e..10b3cef8cc 100644 --- a/exercises/practice/zipper/.meta/Generator.tpl +++ b/exercises/practice/zipper/.meta/Generator.tpl @@ -45,7 +45,7 @@ end }} for op in $0 call = to_call op - calls = string.append calls $".{call}" + calls = string.append calls $"?.{call}" end ret calls diff --git a/exercises/practice/zipper/ZipperTests.cs b/exercises/practice/zipper/ZipperTests.cs index ae90ddc17f..e19a57a6bf 100644 --- a/exercises/practice/zipper/ZipperTests.cs +++ b/exercises/practice/zipper/ZipperTests.cs @@ -7,7 +7,7 @@ public void Data_is_retained() { var tree = new BinTree(1, new BinTree(2, null, new BinTree(3, null, null)), new BinTree(4, null, null)); var sut = Zipper.FromTree(tree); - var actual = sut.ToTree(); + var actual = sut?.ToTree(); var expected = new BinTree(1, new BinTree(2, null, new BinTree(3, null, null)), new BinTree(4, null, null)); Assert.Equal(expected, actual); } @@ -17,7 +17,7 @@ public void Left_right_and_value() { var tree = new BinTree(1, new BinTree(2, null, new BinTree(3, null, null)), new BinTree(4, null, null)); var sut = Zipper.FromTree(tree); - var actual = sut.Left().Right().Value(); + var actual = sut?.Left()?.Right()?.Value(); var expected = 3; Assert.Equal(expected, actual); } @@ -27,7 +27,7 @@ public void Dead_end() { var tree = new BinTree(1, new BinTree(2, null, new BinTree(3, null, null)), new BinTree(4, null, null)); var sut = Zipper.FromTree(tree); - var actual = sut.Left().Left(); + var actual = sut?.Left()?.Left(); Assert.Null(actual); } @@ -36,7 +36,7 @@ public void Tree_from_deep_focus() { var tree = new BinTree(1, new BinTree(2, null, new BinTree(3, null, null)), new BinTree(4, null, null)); var sut = Zipper.FromTree(tree); - var actual = sut.Left().Right().ToTree(); + var actual = sut?.Left()?.Right()?.ToTree(); var expected = new BinTree(1, new BinTree(2, null, new BinTree(3, null, null)), new BinTree(4, null, null)); Assert.Equal(expected, actual); } @@ -46,7 +46,7 @@ public void Traversing_up_from_top() { var tree = new BinTree(1, new BinTree(2, null, new BinTree(3, null, null)), new BinTree(4, null, null)); var sut = Zipper.FromTree(tree); - var actual = sut.Up(); + var actual = sut?.Up(); Assert.Null(actual); } @@ -55,7 +55,7 @@ public void Left_right_and_up() { var tree = new BinTree(1, new BinTree(2, null, new BinTree(3, null, null)), new BinTree(4, null, null)); var sut = Zipper.FromTree(tree); - var actual = sut.Left().Up().Right().Up().Left().Right().Value(); + var actual = sut?.Left()?.Up()?.Right()?.Up()?.Left()?.Right()?.Value(); var expected = 3; Assert.Equal(expected, actual); } @@ -65,7 +65,7 @@ public void Test_ability_to_descend_multiple_levels_and_return() { var tree = new BinTree(1, new BinTree(2, null, new BinTree(3, null, null)), new BinTree(4, null, null)); var sut = Zipper.FromTree(tree); - var actual = sut.Left().Right().Up().Up().Value(); + var actual = sut?.Left()?.Right()?.Up()?.Up()?.Value(); var expected = 1; Assert.Equal(expected, actual); } @@ -75,7 +75,7 @@ public void Set_value() { var tree = new BinTree(1, new BinTree(2, null, new BinTree(3, null, null)), new BinTree(4, null, null)); var sut = Zipper.FromTree(tree); - var actual = sut.Left().SetValue(5).ToTree(); + var actual = sut?.Left()?.SetValue(5)?.ToTree(); var expected = new BinTree(1, new BinTree(5, null, new BinTree(3, null, null)), new BinTree(4, null, null)); Assert.Equal(expected, actual); } @@ -85,7 +85,7 @@ public void Set_value_after_traversing_up() { var tree = new BinTree(1, new BinTree(2, null, new BinTree(3, null, null)), new BinTree(4, null, null)); var sut = Zipper.FromTree(tree); - var actual = sut.Left().Right().Up().SetValue(5).ToTree(); + var actual = sut?.Left()?.Right()?.Up()?.SetValue(5)?.ToTree(); var expected = new BinTree(1, new BinTree(5, null, new BinTree(3, null, null)), new BinTree(4, null, null)); Assert.Equal(expected, actual); } @@ -95,7 +95,7 @@ public void Set_left_with_leaf() { var tree = new BinTree(1, new BinTree(2, null, new BinTree(3, null, null)), new BinTree(4, null, null)); var sut = Zipper.FromTree(tree); - var actual = sut.Left().SetLeft(new BinTree(5, null, null)).ToTree(); + var actual = sut?.Left()?.SetLeft(new BinTree(5, null, null))?.ToTree(); var expected = new BinTree(1, new BinTree(2, new BinTree(5, null, null), new BinTree(3, null, null)), new BinTree(4, null, null)); Assert.Equal(expected, actual); } @@ -105,7 +105,7 @@ public void Set_right_with_null() { var tree = new BinTree(1, new BinTree(2, null, new BinTree(3, null, null)), new BinTree(4, null, null)); var sut = Zipper.FromTree(tree); - var actual = sut.Left().SetRight(null).ToTree(); + var actual = sut?.Left()?.SetRight(null)?.ToTree(); var expected = new BinTree(1, new BinTree(2, null, null), new BinTree(4, null, null)); Assert.Equal(expected, actual); } @@ -115,7 +115,7 @@ public void Set_right_with_subtree() { var tree = new BinTree(1, new BinTree(2, null, new BinTree(3, null, null)), new BinTree(4, null, null)); var sut = Zipper.FromTree(tree); - var actual = sut.SetRight(new BinTree(6, new BinTree(7, null, null), new BinTree(8, null, null))).ToTree(); + var actual = sut?.SetRight(new BinTree(6, new BinTree(7, null, null), new BinTree(8, null, null)))?.ToTree(); var expected = new BinTree(1, new BinTree(2, null, new BinTree(3, null, null)), new BinTree(6, new BinTree(7, null, null), new BinTree(8, null, null))); Assert.Equal(expected, actual); } @@ -125,7 +125,7 @@ public void Set_value_on_deep_focus() { var tree = new BinTree(1, new BinTree(2, null, new BinTree(3, null, null)), new BinTree(4, null, null)); var sut = Zipper.FromTree(tree); - var actual = sut.Left().Right().SetValue(5).ToTree(); + var actual = sut?.Left()?.Right()?.SetValue(5)?.ToTree(); var expected = new BinTree(1, new BinTree(2, null, new BinTree(5, null, null)), new BinTree(4, null, null)); Assert.Equal(expected, actual); } @@ -135,8 +135,8 @@ public void Different_paths_to_same_zipper() { var tree = new BinTree(1, new BinTree(2, null, new BinTree(3, null, null)), new BinTree(4, null, null)); var sut = Zipper.FromTree(tree); - var actual = sut.Left().Up().Right(); - var expected = Zipper.FromTree(new BinTree(1, new BinTree(2, null, new BinTree(3, null, null)), new BinTree(4, null, null))).Right(); + var actual = sut?.Left()?.Up()?.Right(); + var expected = Zipper.FromTree(new BinTree(1, new BinTree(2, null, new BinTree(3, null, null)), new BinTree(4, null, null)))?.Right(); Assert.Equal(expected, actual); } } From d2d53cfa6503b901be70238083c3189f010eab4a Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 15:04:04 +0100 Subject: [PATCH 10/32] tournament: fix --- exercises/practice/tournament/.meta/Example.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/exercises/practice/tournament/.meta/Example.cs b/exercises/practice/tournament/.meta/Example.cs index d505c464e2..bc3e2e9757 100644 --- a/exercises/practice/tournament/.meta/Example.cs +++ b/exercises/practice/tournament/.meta/Example.cs @@ -69,8 +69,7 @@ private void AddResult(string team1, string team2, Outcome outcome) private void AddTeamOutcome(string team, Outcome outcome) { - TeamResult teamResult; - if (this.teams.TryGetValue(team, out teamResult)) { + if (this.teams.TryGetValue(team, out var teamResult)) { teamResult.AddOutcome(outcome); } else { teamResult = new TeamResult(); From 5585def4450489f62fc1ffe9d168ae7aa0e97d4a Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 15:09:06 +0100 Subject: [PATCH 11/32] simple-linked-list: fix --- .../simple-linked-list/.meta/Example.cs | 20 +++++------ .../SimpleLinkedListTests.cs | 36 ++++++++++--------- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/exercises/practice/simple-linked-list/.meta/Example.cs b/exercises/practice/simple-linked-list/.meta/Example.cs index ba5e08b6b1..e9a6064436 100644 --- a/exercises/practice/simple-linked-list/.meta/Example.cs +++ b/exercises/practice/simple-linked-list/.meta/Example.cs @@ -5,11 +5,11 @@ public class SimpleLinkedList : IEnumerable { private class Node { - public T Value { get; set; } - public Node Next { get; set; } + public required T Value { get; set; } + public Node? Next { get; set; } } - private Node head; + private Node? _head; public SimpleLinkedList() { } @@ -24,25 +24,25 @@ public SimpleLinkedList(params T[] values) public void Push(T value) { - var node = new Node { Value = value, Next = this.head }; - this.head = node; + var node = new Node { Value = value, Next = this._head }; + this._head = node; this.Count++; } public T Pop() { - if (this.head == null) { + if (this._head == null) { throw new InvalidOperationException("List is empty!"); } - var value = head.Value; - head = head.Next; + var value = _head.Value; + _head = _head.Next; this.Count--; return value; } public IEnumerator GetEnumerator() { - var current = this.head; + var current = this._head; while(current != null) { yield return current.Value; current = current.Next; @@ -50,4 +50,4 @@ public IEnumerator GetEnumerator() } IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); -} \ No newline at end of file +} diff --git a/exercises/practice/simple-linked-list/SimpleLinkedListTests.cs b/exercises/practice/simple-linked-list/SimpleLinkedListTests.cs index 3d78d198dc..c29fbb74b3 100644 --- a/exercises/practice/simple-linked-list/SimpleLinkedListTests.cs +++ b/exercises/practice/simple-linked-list/SimpleLinkedListTests.cs @@ -12,15 +12,16 @@ public void Empty_list_has_no_elements() Assert.Equal(0, list.Count); } - [Fact(Skip = "Remove this Skip property to run this test")] + [Fact()] public void Count_cannot_be_changed_from_the_outside() { var count = typeof(SimpleLinkedList<>).GetProperty("Count"); - Assert.True(count?.GetGetMethod().IsPublic); - Assert.False(count?.GetSetMethod(true).IsPublic); + Assert.NotNull(count); + Assert.True(count.GetGetMethod() is { IsPublic: true }); + Assert.False(count.GetSetMethod(true) is { IsPublic: true }); } - [Fact(Skip = "Remove this Skip property to run this test")] + [Fact()] public void Pushing_elements_to_the_list_increases_the_count() { var list = new SimpleLinkedList(); @@ -30,7 +31,7 @@ public void Pushing_elements_to_the_list_increases_the_count() Assert.Equal(2, list.Count); } - [Fact(Skip = "Remove this Skip property to run this test")] + [Fact()] public void Popping_elements_from_the_list_decreases_the_count() { var list = new SimpleLinkedList(); @@ -41,7 +42,7 @@ public void Popping_elements_from_the_list_decreases_the_count() Assert.Equal(1, list.Count); } - [Fact(Skip = "Remove this Skip property to run this test")] + [Fact()] public void Elements_pop_back_in_lifo_order() { var list = new SimpleLinkedList(); @@ -56,19 +57,20 @@ public void Elements_pop_back_in_lifo_order() private static SimpleLinkedList CreateSimpleLinkedList(int value) { var type = typeof(SimpleLinkedList<>).MakeGenericType(typeof(int)); - var constructor = type.GetConstructor(new Type[] { typeof(int) }); - return (SimpleLinkedList)constructor?.Invoke(new object[]{ value }) - ?? CreateSimpleLinkedList(new int[] { value }); + var constructor = type.GetConstructor([typeof(int)]); + return (SimpleLinkedList?)constructor?.Invoke([value]) + ?? CreateSimpleLinkedList([value]); } private static SimpleLinkedList CreateSimpleLinkedList(params int[] values) { var type = typeof(SimpleLinkedList<>).MakeGenericType(typeof(int)); - var constructor = type.GetConstructor(new Type[]{typeof(int[])}); - return (SimpleLinkedList)constructor.Invoke(new object[]{ values }); + var constructor = type.GetConstructor([typeof(int[])]); + Assert.NotNull(constructor); + return (SimpleLinkedList)constructor.Invoke([values]); } - [Fact(Skip = "Remove this Skip property to run this test")] + [Fact()] public void Single_value_initialisation() { var list = CreateSimpleLinkedList(7); @@ -76,7 +78,7 @@ public void Single_value_initialisation() Assert.Equal(7, list.Pop()); } - [Fact(Skip = "Remove this Skip property to run this test")] + [Fact()] public void Multi_value_initialisation() { var list = CreateSimpleLinkedList(2, 1, 3); @@ -85,7 +87,7 @@ public void Multi_value_initialisation() Assert.Equal(2, list.Pop()); } - [Fact(Skip = "Remove this Skip property to run this test")] + [Fact()] public void From_enumerable() { var list = CreateSimpleLinkedList(new[] { 11, 7, 5, 3, 2 }); @@ -96,7 +98,7 @@ public void From_enumerable() Assert.Equal(11, list.Pop()); } - [Fact(Skip = "Remove this Skip property to run this test")] + [Fact()] public void Reverse_enumerable() { var values = Enumerable.Range(1, 5).ToArray(); @@ -106,7 +108,7 @@ public void Reverse_enumerable() Assert.Equal(values, reversed); } - [Fact(Skip = "Remove this Skip property to run this test")] + [Fact()] public void Roundtrip() { var values = Enumerable.Range(1, 7); @@ -114,4 +116,4 @@ public void Roundtrip() var enumerable = Assert.IsAssignableFrom>(list); Assert.Equal(values.Reverse(), enumerable); } -} \ No newline at end of file +} From afe8353295ef039cd6b40cb2cc1c31749fa8a214 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 15:13:04 +0100 Subject: [PATCH 12/32] sgf-parsing: fix --- exercises/practice/sgf-parsing/.meta/Example.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/exercises/practice/sgf-parsing/.meta/Example.cs b/exercises/practice/sgf-parsing/.meta/Example.cs index 12b4ebb082..66e7e155d9 100644 --- a/exercises/practice/sgf-parsing/.meta/Example.cs +++ b/exercises/practice/sgf-parsing/.meta/Example.cs @@ -14,12 +14,15 @@ public SgfTree(IDictionary data, params SgfTree[] children) Children = children; } - public bool Equals(SgfTree other) + public bool Equals(SgfTree? other) { + if (other == null) + return false; + var otherData = other.Data; foreach (var d in Data) - if (!d.Value.SequenceEqual(otherData.Where(od => od.Key == d.Key)?.FirstOrDefault().Value)) + if (!d.Value.SequenceEqual(otherData.Where(od => od.Key == d.Key)?.FirstOrDefault().Value ?? [])) return false; if (Children != null) @@ -93,4 +96,4 @@ private static SgfTree NodesToTree(IEnumerable> pr return new SgfTree(properties.First(), NodesToTree(properties.Skip(1), trees)); } -} \ No newline at end of file +} From a935891f27243e366b3bae8bfec0f6f8794d8464 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 15:18:48 +0100 Subject: [PATCH 13/32] rest-api: fix --- exercises/practice/rest-api/.meta/Example.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/exercises/practice/rest-api/.meta/Example.cs b/exercises/practice/rest-api/.meta/Example.cs index 68004dc8fc..f60e09a418 100644 --- a/exercises/practice/rest-api/.meta/Example.cs +++ b/exercises/practice/rest-api/.meta/Example.cs @@ -84,14 +84,14 @@ public class RestApi public RestApi(string database) { - users = JsonSerializer.Deserialize>(database); + users = JsonSerializer.Deserialize>(database)!; } - public string Get(string url, string payload = null) + public string Get(string url, string? payload = null) { if (payload != null) { - var values = JsonSerializer.Deserialize>>(payload); + var values = JsonSerializer.Deserialize>>(payload)!; var requestedUsers = values["users"]; return JsonSerializer.Serialize(users.Where(x => requestedUsers.Contains(x.name))); } @@ -104,22 +104,22 @@ public string Post(string url, string payload) if (url == "/add") { var values = JsonSerializer.Deserialize>(payload); - var newUser = new User(values["user"]); + var newUser = new User(values!["user"]); users.Add(newUser); return JsonSerializer.Serialize(newUser); } else if (url == "/iou") { - var values = JsonSerializer.Deserialize>(payload); + var values = JsonSerializer.Deserialize>(payload)!; var lender = users.First(x => x.name.Equals(values["lender"].ToString())); var borrower = users.First(x => x.name.Equals(values["borrower"].ToString())); - var amount = double.Parse(values["amount"].ToString()); + var amount = double.Parse(values["amount"].ToString()!); lender.Lend(borrower, amount); borrower.Borrow(lender, amount); return JsonSerializer.Serialize(new[] { lender, borrower }.OrderBy(x => x.name)); } - return String.Empty; + return string.Empty; } } From e7ce50ea67df4b70eb8712b1162e1f132202d55f Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 15:21:30 +0100 Subject: [PATCH 14/32] react: fix --- exercises/practice/react/.meta/Example.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/exercises/practice/react/.meta/Example.cs b/exercises/practice/react/.meta/Example.cs index 9004ef247e..f475ee47a0 100644 --- a/exercises/practice/react/.meta/Example.cs +++ b/exercises/practice/react/.meta/Example.cs @@ -25,8 +25,11 @@ public ComputeCell CreateComputeCell(IEnumerable producers, Func Changed; + public override event EventHandler? Changed; public override int Value { @@ -107,7 +110,7 @@ public ComputeCell(int id, IEnumerable producers, Func compute } public override int Value { get; set; } - public override event EventHandler Changed; + public override event EventHandler? Changed; public void Recompute() { From 4dbfe242d7ad6c0f64ea666be5f118bfe29e547d Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 15:22:42 +0100 Subject: [PATCH 15/32] robot-name: fix --- exercises/practice/robot-name/.meta/Example.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/practice/robot-name/.meta/Example.cs b/exercises/practice/robot-name/.meta/Example.cs index e15b800b8d..919cdabe12 100644 --- a/exercises/practice/robot-name/.meta/Example.cs +++ b/exercises/practice/robot-name/.meta/Example.cs @@ -10,7 +10,7 @@ public class Robot public Robot() { - Reset(); + Name = GenerateName(); } private static string GenerateName() From a574c2fc7472992006bd1cc496ec13a30c7f17d9 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 15:25:23 +0100 Subject: [PATCH 16/32] say: fix --- exercises/practice/say/.meta/Example.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/exercises/practice/say/.meta/Example.cs b/exercises/practice/say/.meta/Example.cs index b89f72663f..e9ce4648b9 100644 --- a/exercises/practice/say/.meta/Example.cs +++ b/exercises/practice/say/.meta/Example.cs @@ -32,10 +32,10 @@ private static IEnumerable Parts(long number) var thousands = Thousands(thousandsCount); var hundreds = Hundreds(remainder); - return new[] { billions, millions, thousands, hundreds }.Where(x => x != null); + return new[] { billions, millions, thousands, hundreds }.Where(x => x != null).Cast(); } - private static string Bases(long number) + private static string? Bases(long number) { var values = new[] { @@ -63,7 +63,7 @@ private static string Bases(long number) return number > 0 && number <= values.Length ? values[number - 1] : null; } - private static string Tens(long number) + private static string? Tens(long number) { if (number < 20L) { @@ -92,7 +92,7 @@ private static string Tens(long number) return $"{countStr}{basesStr}"; } - private static string Hundreds(long number) + private static string? Hundreds(long number) { if (number < 100L) { @@ -108,15 +108,15 @@ private static string Hundreds(long number) return $"{bases} hundred{tensStr}"; } - private static string Chunk(string str, long number) + private static string? Chunk(string str, long number) { var hundreds = Hundreds(number); return hundreds == null ? null : $"{hundreds} {str}"; } - private static string Thousands(long number) => Chunk("thousand", number); - private static string Millions(long number) => Chunk("million", number); - private static string Billions(long number) => Chunk("billion", number); + private static string? Thousands(long number) => Chunk("thousand", number); + private static string? Millions(long number) => Chunk("million", number); + private static string? Billions(long number) => Chunk("billion", number); private static Tuple Counts(long number) { @@ -131,4 +131,4 @@ private static Tuple Counts(long number) return Tuple.Create(billionsCount, millionsCount, thousandsCount, thousandsRemainder); } -} \ No newline at end of file +} From 454476648b76b0958fef688c6177038f100a4568 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 15:27:18 +0100 Subject: [PATCH 17/32] satellite: fix --- exercises/practice/satellite/.meta/Example.cs | 6 +++--- exercises/practice/satellite/Satellite.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/practice/satellite/.meta/Example.cs b/exercises/practice/satellite/.meta/Example.cs index 7aa5212227..d9a1f742a7 100644 --- a/exercises/practice/satellite/.meta/Example.cs +++ b/exercises/practice/satellite/.meta/Example.cs @@ -1,11 +1,11 @@ using System; using System.Linq; -public record Tree(char Value, Tree Left, Tree Right); +public record Tree(char Value, Tree? Left, Tree? Right); public static class Satellite { - public static Tree TreeFromTraversals(char[] preOrder, char[] inOrder) + public static Tree? TreeFromTraversals(char[] preOrder, char[] inOrder) { if (preOrder.Length != inOrder.Length) throw new ArgumentException("Traversals must have the same length"); if (!preOrder.Order().SequenceEqual(inOrder.Order())) throw new ArgumentException("Traversals must be consistent"); @@ -15,7 +15,7 @@ public static Tree TreeFromTraversals(char[] preOrder, char[] inOrder) return TreeFromTraversals(preOrder, inOrder, ref preOrderIndex, 0, preOrder.Length - 1); } - private static Tree TreeFromTraversals(char[] preOrder, char[] inOrder, ref int preOrderIndex, int left, int right) + private static Tree? TreeFromTraversals(char[] preOrder, char[] inOrder, ref int preOrderIndex, int left, int right) { if (left > right) return null; diff --git a/exercises/practice/satellite/Satellite.cs b/exercises/practice/satellite/Satellite.cs index bcad75267c..8868feeb14 100644 --- a/exercises/practice/satellite/Satellite.cs +++ b/exercises/practice/satellite/Satellite.cs @@ -4,7 +4,7 @@ public record Tree(char Value, Tree? Left, Tree? Right); public static class Satellite { - public static Tree TreeFromTraversals(char[] preOrder, char[] inOrder) + public static Tree? TreeFromTraversals(char[] preOrder, char[] inOrder) { throw new NotImplementedException("You need to implement this method."); } From 6ce4d1fb60620826ba7d1f84a7049f1c7abf1b29 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 15:28:32 +0100 Subject: [PATCH 18/32] change: fix --- exercises/practice/change/.meta/Example.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/practice/change/.meta/Example.cs b/exercises/practice/change/.meta/Example.cs index 7756480830..566521e12f 100644 --- a/exercises/practice/change/.meta/Example.cs +++ b/exercises/practice/change/.meta/Example.cs @@ -37,7 +37,7 @@ Dictionary> UpdateMinimalCoinsMap(Dictionary> curr return current; } - List MinimalCoins(Dictionary> current, int subTarget) + List? MinimalCoins(Dictionary> current, int subTarget) { return coins .Where(coin => coin <= subTarget) @@ -45,7 +45,7 @@ List MinimalCoins(Dictionary> current, int subTarget) ? subTargetMinimalCoins.Append(coin).ToList() : null) .Where(subTargetMinimalCoins => subTargetMinimalCoins != null) - .OrderBy(subTargetMinimalCoins => subTargetMinimalCoins.Count) + .OrderBy(subTargetMinimalCoins => subTargetMinimalCoins!.Count) .FirstOrDefault(); } } From f9b5d4bdda57c8c4373a6a80ddea9e56fcb85204 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 15:29:15 +0100 Subject: [PATCH 19/32] custom-set: fix --- exercises/practice/custom-set/.meta/Example.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/practice/custom-set/.meta/Example.cs b/exercises/practice/custom-set/.meta/Example.cs index f4f9ae718b..f6273f67bc 100644 --- a/exercises/practice/custom-set/.meta/Example.cs +++ b/exercises/practice/custom-set/.meta/Example.cs @@ -45,7 +45,7 @@ public CustomSet Union(CustomSet right) private int[] GetValuesFromKeys(IEnumerable keys) => keys.Select(key => items[key]).ToArray(); - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (!(obj is CustomSet other)) { From 77e7cff205e5a0ec9fef1c90131014b090757b90 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 15:31:18 +0100 Subject: [PATCH 20/32] grep: fix --- exercises/practice/grep/.meta/Example.cs | 28 +++++++----------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/exercises/practice/grep/.meta/Example.cs b/exercises/practice/grep/.meta/Example.cs index 7b20619f3b..ff19ede7cf 100644 --- a/exercises/practice/grep/.meta/Example.cs +++ b/exercises/practice/grep/.meta/Example.cs @@ -6,12 +6,7 @@ public static class Grep { - private class Line - { - public int Number { get; set; } - public string Text { get; set; } - public string File { get; set; } - } + private record Line(string File, int Number, string Text); [Flags] private enum Flags @@ -69,7 +64,7 @@ private static IEnumerable FindMatchingLines(string pattern, Flags flags, .Where(isMatch); } - private static Line CreateLine(string file, int index, string text) => new Line { File = file, Number = index + 1, Text = text }; + private static Line CreateLine(string file, int index, string text) => new(file, index + 1, text); private static string FormatMatchingFile(string file) => $"{file}"; @@ -87,20 +82,13 @@ private static string FormatMatchingLine(Flags flags, string[] files, Line line) var printLineNumbers = flags.HasFlag(Flags.PrintLineNumbers); var printFileName = files.Length > 1; - if (printLineNumbers && printFileName) - { - return $"{line.File}:{line.Number}:{line.Text}"; - } - if (printLineNumbers && !printFileName) + return printLineNumbers switch { - return $"{line.Number}:{line.Text}"; - } - if (!printLineNumbers && printFileName) - { - return $"{line.File}:{line.Text}"; - } - - return $"{line.Text}"; + true when printFileName => $"{line.File}:{line.Number}:{line.Text}", + true when !printFileName => $"{line.Number}:{line.Text}", + false when printFileName => $"{line.File}:{line.Text}", + _ => $"{line.Text}" + }; } private static string FormatMatchingLines(string pattern, Flags flags, string[] files) From a0f760650fc9ea3f748ff31215bb3277c905d496 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 15:42:35 +0100 Subject: [PATCH 21/32] binary-search-tree: fix --- .../binary-search-tree/.meta/Example.cs | 6 +++--- .../binary-search-tree/.meta/Generator.tpl | 4 ++-- .../binary-search-tree/BinarySearchTree.cs | 4 ++-- .../BinarySearchTreeTests.cs | 18 +++++++++--------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/exercises/practice/binary-search-tree/.meta/Example.cs b/exercises/practice/binary-search-tree/.meta/Example.cs index a77fc35bf5..34155833fa 100644 --- a/exercises/practice/binary-search-tree/.meta/Example.cs +++ b/exercises/practice/binary-search-tree/.meta/Example.cs @@ -29,9 +29,9 @@ public BinarySearchTree(IEnumerable values) public int Value { get; } - public BinarySearchTree Left { get; private set; } + public BinarySearchTree? Left { get; private set; } - public BinarySearchTree Right { get; private set; } + public BinarySearchTree? Right { get; private set; } public BinarySearchTree Add(int value) { @@ -47,7 +47,7 @@ public BinarySearchTree Add(int value) return this; } - private static BinarySearchTree Add(int value, BinarySearchTree tree) + private static BinarySearchTree Add(int value, BinarySearchTree? tree) { if (tree == null) { diff --git a/exercises/practice/binary-search-tree/.meta/Generator.tpl b/exercises/practice/binary-search-tree/.meta/Generator.tpl index d7ad8d8969..90f7c55998 100644 --- a/exercises/practice/binary-search-tree/.meta/Generator.tpl +++ b/exercises/practice/binary-search-tree/.meta/Generator.tpl @@ -2,11 +2,11 @@ checks = [$"Assert.Equal({string.to_int node.data}, tree.{path}Value);"] if node.left - checks = array.add_range checks (assertions node.left (path + "Left.")) + checks = array.add_range checks (assertions node.left (path + "Left?.")) end if node.right - checks = array.add_range checks (assertions node.right (path + "Right.")) + checks = array.add_range checks (assertions node.right (path + "Right?.")) end ret checks diff --git a/exercises/practice/binary-search-tree/BinarySearchTree.cs b/exercises/practice/binary-search-tree/BinarySearchTree.cs index f1a20129b2..71f354de0a 100644 --- a/exercises/practice/binary-search-tree/BinarySearchTree.cs +++ b/exercises/practice/binary-search-tree/BinarySearchTree.cs @@ -20,7 +20,7 @@ public int Value } } - public BinarySearchTree Left + public BinarySearchTree? Left { get { @@ -28,7 +28,7 @@ public BinarySearchTree Left } } - public BinarySearchTree Right + public BinarySearchTree? Right { get { diff --git a/exercises/practice/binary-search-tree/BinarySearchTreeTests.cs b/exercises/practice/binary-search-tree/BinarySearchTreeTests.cs index 18698389fa..1eae967713 100644 --- a/exercises/practice/binary-search-tree/BinarySearchTreeTests.cs +++ b/exercises/practice/binary-search-tree/BinarySearchTreeTests.cs @@ -15,7 +15,7 @@ public void Insert_data_at_proper_node_smaller_number_at_left_node() { var tree = new BinarySearchTree(new[] { 4, 2 }); Assert.Equal(4, tree.Value); - Assert.Equal(2, tree.Left.Value); + Assert.Equal(2, tree.Left?.Value); } [Fact(Skip = "Remove this Skip property to run this test")] @@ -23,7 +23,7 @@ public void Insert_data_at_proper_node_same_number_at_left_node() { var tree = new BinarySearchTree(new[] { 4, 4 }); Assert.Equal(4, tree.Value); - Assert.Equal(4, tree.Left.Value); + Assert.Equal(4, tree.Left?.Value); } [Fact(Skip = "Remove this Skip property to run this test")] @@ -31,7 +31,7 @@ public void Insert_data_at_proper_node_greater_number_at_right_node() { var tree = new BinarySearchTree(new[] { 4, 5 }); Assert.Equal(4, tree.Value); - Assert.Equal(5, tree.Right.Value); + Assert.Equal(5, tree.Right?.Value); } [Fact(Skip = "Remove this Skip property to run this test")] @@ -39,12 +39,12 @@ public void Can_create_complex_tree() { var tree = new BinarySearchTree(new[] { 4, 2, 6, 1, 3, 5, 7 }); Assert.Equal(4, tree.Value); - Assert.Equal(2, tree.Left.Value); - Assert.Equal(1, tree.Left.Left.Value); - Assert.Equal(3, tree.Left.Right.Value); - Assert.Equal(6, tree.Right.Value); - Assert.Equal(5, tree.Right.Left.Value); - Assert.Equal(7, tree.Right.Right.Value); + Assert.Equal(2, tree.Left?.Value); + Assert.Equal(1, tree.Left?.Left?.Value); + Assert.Equal(3, tree.Left?.Right?.Value); + Assert.Equal(6, tree.Right?.Value); + Assert.Equal(5, tree.Right?.Left?.Value); + Assert.Equal(7, tree.Right?.Right?.Value); } [Fact(Skip = "Remove this Skip property to run this test")] From 00326bcfd21077bf8365c1ec30354407179bfe4b Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 15:45:36 +0100 Subject: [PATCH 22/32] linked-list: fix --- .../practice/linked-list/.meta/Example.cs | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/exercises/practice/linked-list/.meta/Example.cs b/exercises/practice/linked-list/.meta/Example.cs index ecd4479c4b..9c2da8c969 100644 --- a/exercises/practice/linked-list/.meta/Example.cs +++ b/exercises/practice/linked-list/.meta/Example.cs @@ -1,6 +1,6 @@ public class Deque { - private Element head; + private Element? head; public void Push(T value) { @@ -10,7 +10,7 @@ public void Push(T value) } else { - var last = head.Next; + var last = head.Next!; var e = new Element(value, last, head); last.Prev = e; head.Next = e; @@ -19,27 +19,27 @@ public void Push(T value) public T Pop() { - head = head.Next; + head = head?.Next; return Shift(); } public void Unshift(T value) { Push(value); - head = head.Next; + head = head?.Next; } public T Shift() { - var value = head.Value; - var last = head.Next; + var value = head!.Value; + var last = head.Next!; if (last == head) head = null; else { last.Prev = head.Prev; - head.Prev.Next = last; + head.Prev!.Next = last; head = head.Prev; } @@ -49,10 +49,10 @@ public T Shift() private class Element { public readonly T Value; - public Element Next; - public Element Prev; + public Element? Next; + public Element? Prev; - public Element(T value, Element next = null, Element prev = null) + public Element(T value, Element? next = null, Element? prev = null) { Value = value; Next = next ?? this; From 23670b34f54e7aa271bbfe69abf4b799ecf495f6 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 15:47:16 +0100 Subject: [PATCH 23/32] alphametics: fix --- exercises/practice/alphametics/.meta/Example.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/practice/alphametics/.meta/Example.cs b/exercises/practice/alphametics/.meta/Example.cs index 7af1e1ae66..81c3622b2f 100644 --- a/exercises/practice/alphametics/.meta/Example.cs +++ b/exercises/practice/alphametics/.meta/Example.cs @@ -57,7 +57,7 @@ private void ProcessOperand(string operand, long multiplyCountBy) public static class AlphameticsSolver { - private static AlphameticsEquation _equation; + private static AlphameticsEquation? _equation; public static IDictionary Solve(AlphameticsEquation equation) { @@ -77,19 +77,19 @@ private static bool IsSolution(int[] letterCountCombination) if (LetterCountHasInvalidNonZeroLetter()) return false; - return _equation.LettersWithCount.Values + return _equation!.LettersWithCount.Values .Zip(letterCountCombination, (count, solutionCount) => count * solutionCount).Sum() == 0; bool LetterCountHasInvalidNonZeroLetter() { var zeroLetterIndex = Array.IndexOf(letterCountCombination, 0); - return zeroLetterIndex != -1 && _equation.NonZeroLetters.Contains(_equation.LettersWithCount.Keys.ElementAt(zeroLetterIndex)); + return zeroLetterIndex != -1 && _equation!.NonZeroLetters.Contains(_equation.LettersWithCount.Keys.ElementAt(zeroLetterIndex)); } } private static Dictionary SolutionForLetterCount(IEnumerable letterCount) => letterCount - .Zip(_equation.LettersWithCount.Keys, (x, y) => new KeyValuePair(y, x)) + .Zip(_equation!.LettersWithCount.Keys, (x, y) => new KeyValuePair(y, x)) .ToDictionary(x => x.Key, x => x.Value); } From fcc0bf043163fea49574aad23993b33522b1c418 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 15:51:27 +0100 Subject: [PATCH 24/32] hangman: fix --- exercises/practice/hangman/HangmanTests.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/exercises/practice/hangman/HangmanTests.cs b/exercises/practice/hangman/HangmanTests.cs index e8d17505a2..b9d9787113 100644 --- a/exercises/practice/hangman/HangmanTests.cs +++ b/exercises/practice/hangman/HangmanTests.cs @@ -49,8 +49,10 @@ public void Initial_state_has_no_guessed_chars() public void Guess_changes_state() { var hangman = new Hangman("foo"); - HangmanState actual = null; + HangmanState? actual = null; hangman.StateObservable.Subscribe(x => actual = x); + + Assert.NotNull(actual); var initial = actual; // +--x-> @@ -64,8 +66,10 @@ public void Guess_changes_state() public void Wrong_guess_decrements_remaining_guesses() { var hangman = new Hangman("foo"); - HangmanState actual = null; + HangmanState? actual = null; hangman.StateObservable.Subscribe(x => actual = x); + + Assert.NotNull(actual); var initial = actual; // +--x-> From 98788b4346c2f1fafee9fc2ec97ce97acacc0a4e Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 16:18:46 +0100 Subject: [PATCH 25/32] wizards-and-warriors-2: fix --- exercises/concept/wizards-and-warriors-2/.meta/Exemplar.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exercises/concept/wizards-and-warriors-2/.meta/Exemplar.cs b/exercises/concept/wizards-and-warriors-2/.meta/Exemplar.cs index f34eab43bc..eba0f8cde6 100644 --- a/exercises/concept/wizards-and-warriors-2/.meta/Exemplar.cs +++ b/exercises/concept/wizards-and-warriors-2/.meta/Exemplar.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS8618 + static class GameMaster { public static string Describe(Character character) @@ -44,3 +46,5 @@ enum TravelMethod Walking, Horseback } + +#pragma warning restore CS8618 From 2cb6b76055317731647469a67c9e6fa77cf109e4 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 16:19:21 +0100 Subject: [PATCH 26/32] remote-control-cleanup: fix --- exercises/concept/remote-control-cleanup/.meta/Exemplar.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exercises/concept/remote-control-cleanup/.meta/Exemplar.cs b/exercises/concept/remote-control-cleanup/.meta/Exemplar.cs index 0fd5986a81..d9023f560f 100644 --- a/exercises/concept/remote-control-cleanup/.meta/Exemplar.cs +++ b/exercises/concept/remote-control-cleanup/.meta/Exemplar.cs @@ -1,3 +1,5 @@ +#pragma warning disable CS8618 + public class RemoteControlCar { private enum SpeedUnits @@ -95,3 +97,5 @@ private void SetSpeed(Speed speed) currentSpeed = speed; } } + +#pragma warning restore CS8618 From 2e903f90a8dc46b2aa25941ce8688f031f610bb5 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 16:20:42 +0100 Subject: [PATCH 27/32] land-grab-in-space: fix --- .../land-grab-in-space/LandGrabInSpaceTests.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/exercises/concept/land-grab-in-space/LandGrabInSpaceTests.cs b/exercises/concept/land-grab-in-space/LandGrabInSpaceTests.cs index 9f64a20c63..f52580ffc8 100644 --- a/exercises/concept/land-grab-in-space/LandGrabInSpaceTests.cs +++ b/exercises/concept/land-grab-in-space/LandGrabInSpaceTests.cs @@ -74,16 +74,13 @@ public void GetLongestSideReverseInsertionOrder() private Plot CreatePlot(Coord coord1, Coord coord2, Coord coord3, Coord coord4) { Type plotType = typeof(Plot); - Type[] types = new Type[] { typeof(Coord), typeof(Coord), typeof(Coord), typeof(Coord) }; - ConstructorInfo constructorInfoObj = plotType.GetConstructor(types); + Type[] types = [typeof(Coord), typeof(Coord), typeof(Coord), typeof(Coord)]; + ConstructorInfo? constructorInfoObj = plotType.GetConstructor(types); if (constructorInfoObj != null) { - return (Plot)constructorInfoObj.Invoke(new object[] { coord1, coord2, coord3, coord4 }); + return (Plot)constructorInfoObj.Invoke([coord1, coord2, coord3, coord4]); } - else - { - throw new InvalidOperationException("You need to implement a constructor for the struct Plot. The constructor must take 4 co-ordinates. No such constructor can be found."); - } + throw new InvalidOperationException("You need to implement a constructor for the struct Plot. The constructor must take 4 co-ordinates. No such constructor can be found."); } } From a4649ef5dfd1ddef2a79301aa71333b9c907195a Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 16:21:44 +0100 Subject: [PATCH 28/32] instruments-of-texas: fix --- exercises/concept/instruments-of-texas/.meta/Exemplar.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/concept/instruments-of-texas/.meta/Exemplar.cs b/exercises/concept/instruments-of-texas/.meta/Exemplar.cs index 9d8a76d1e9..a9c1d11dfc 100644 --- a/exercises/concept/instruments-of-texas/.meta/Exemplar.cs +++ b/exercises/concept/instruments-of-texas/.meta/Exemplar.cs @@ -30,11 +30,11 @@ public string TestMultiplication(int x, int y) } catch (CalculationException cex) when (cex.Operand1 < 0 && cex.Operand2 < 0) { - return "Multiply failed for negative operands. " + cex.InnerException.Message; + return "Multiply failed for negative operands. " + cex.InnerException!.Message; } catch (CalculationException cex) { - return "Multiply failed for mixed or positive operands. " + cex.InnerException.Message; + return "Multiply failed for mixed or positive operands. " + cex.InnerException!.Message; } } From a3ba07616264e9c9202fb87eecd5059a98f51e6c Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 16:23:27 +0100 Subject: [PATCH 29/32] markdown: fix --- exercises/practice/markdown/.meta/Example.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/practice/markdown/.meta/Example.cs b/exercises/practice/markdown/.meta/Example.cs index e0e2107dc8..e5520715b4 100644 --- a/exercises/practice/markdown/.meta/Example.cs +++ b/exercises/practice/markdown/.meta/Example.cs @@ -39,7 +39,7 @@ private static string ParseText(this string markdown, bool list) return list ? textHtml : textHtml.WrapInTag(ParagraphTag); } - private static Tuple ParseHeader(this string markdown, bool list) + private static Tuple? ParseHeader(this string markdown, bool list) { var headerNumber = markdown @@ -56,7 +56,7 @@ private static Tuple ParseHeader(this string markdown, bool list) return Tuple.Create(false, html); } - private static Tuple ParseLineItem(this string markdown, bool list) + private static Tuple? ParseLineItem(this string markdown, bool list) { if (!markdown.StartsWith(ListItemMarkdown)) return null; @@ -105,4 +105,4 @@ public static string Parse(string markdown) return list ? html + ClosingTag(ListTag) : html; } -} \ No newline at end of file +} From f91be2d31eb96bdc2999acf390857b47cba1358c Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 16:25:07 +0100 Subject: [PATCH 30/32] Dont remove nullable in new exercise --- bin/add-practice-exercise.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/add-practice-exercise.ps1 b/bin/add-practice-exercise.ps1 index 21ab2d6f6c..16b1cabbc0 100644 --- a/bin/add-practice-exercise.ps1 +++ b/bin/add-practice-exercise.ps1 @@ -39,7 +39,6 @@ $project = "${exerciseDir}/${ExerciseName}.csproj" [xml]$projectXml = Get-Content "${project}" $projectXml.Project.RemoveChild($projectXml.Project.ItemGroup[1]) $projectXml.Project.PropertyGroup.RemoveChild($projectXml.Project.PropertyGroup.SelectSingleNode("ImplicitUsings")) -$projectXml.Project.PropertyGroup.RemoveChild($projectXml.Project.PropertyGroup.SelectSingleNode("Nullable")) $projectXml.Save("${project}") # Update project packages From caca361fb81ffe6604ab48ae813e6558a79c4f88 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 16:38:29 +0100 Subject: [PATCH 31/32] More fixes --- .../FootballMatchReports.csproj | 1 - .../tim-from-marketing/TimFromMarketing.csproj | 1 - .../performance/code/Benchmark_Csharp.csproj | 1 - .../performance/code/Benchmark_Csharp.csproj | 1 - .../performance/code/Benchmark_Csharp.csproj | 1 - .../performance/code/Benchmark_Csharp.csproj | 1 - .../code/BenchmarkIsPalindrome.csproj | 1 - .../performance/code/Benchmark_Csharp.csproj | 1 - .../performance/code/Benchmark_Csharp.csproj | 1 - .../performance/code/Benchmark_Csharp.csproj | 1 - .../performance/code/Benchmark.csproj | 1 - .../SimpleLinkedListTests.cs | 18 +++++++++--------- 12 files changed, 9 insertions(+), 20 deletions(-) diff --git a/exercises/concept/football-match-reports/FootballMatchReports.csproj b/exercises/concept/football-match-reports/FootballMatchReports.csproj index 85d763a267..590e2b629e 100644 --- a/exercises/concept/football-match-reports/FootballMatchReports.csproj +++ b/exercises/concept/football-match-reports/FootballMatchReports.csproj @@ -3,7 +3,6 @@ net9.0 enable - enable true diff --git a/exercises/concept/tim-from-marketing/TimFromMarketing.csproj b/exercises/concept/tim-from-marketing/TimFromMarketing.csproj index 85d763a267..590e2b629e 100644 --- a/exercises/concept/tim-from-marketing/TimFromMarketing.csproj +++ b/exercises/concept/tim-from-marketing/TimFromMarketing.csproj @@ -3,7 +3,6 @@ net9.0 enable - enable true diff --git a/exercises/practice/bob/.articles/performance/code/Benchmark_Csharp.csproj b/exercises/practice/bob/.articles/performance/code/Benchmark_Csharp.csproj index 3e9d5d040a..2ec2bf993c 100644 --- a/exercises/practice/bob/.articles/performance/code/Benchmark_Csharp.csproj +++ b/exercises/practice/bob/.articles/performance/code/Benchmark_Csharp.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - enable true diff --git a/exercises/practice/grains/.articles/performance/code/Benchmark_Csharp.csproj b/exercises/practice/grains/.articles/performance/code/Benchmark_Csharp.csproj index 3e9d5d040a..2ec2bf993c 100644 --- a/exercises/practice/grains/.articles/performance/code/Benchmark_Csharp.csproj +++ b/exercises/practice/grains/.articles/performance/code/Benchmark_Csharp.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - enable true diff --git a/exercises/practice/isogram/.articles/performance/code/Benchmark_Csharp.csproj b/exercises/practice/isogram/.articles/performance/code/Benchmark_Csharp.csproj index 3e9d5d040a..2ec2bf993c 100644 --- a/exercises/practice/isogram/.articles/performance/code/Benchmark_Csharp.csproj +++ b/exercises/practice/isogram/.articles/performance/code/Benchmark_Csharp.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - enable true diff --git a/exercises/practice/leap/.articles/performance/code/Benchmark_Csharp.csproj b/exercises/practice/leap/.articles/performance/code/Benchmark_Csharp.csproj index 3e9d5d040a..2ec2bf993c 100644 --- a/exercises/practice/leap/.articles/performance/code/Benchmark_Csharp.csproj +++ b/exercises/practice/leap/.articles/performance/code/Benchmark_Csharp.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - enable true diff --git a/exercises/practice/palindrome-products/.articles/is-palindrome-check/code/BenchmarkIsPalindrome.csproj b/exercises/practice/palindrome-products/.articles/is-palindrome-check/code/BenchmarkIsPalindrome.csproj index e22198328f..10430fd745 100644 --- a/exercises/practice/palindrome-products/.articles/is-palindrome-check/code/BenchmarkIsPalindrome.csproj +++ b/exercises/practice/palindrome-products/.articles/is-palindrome-check/code/BenchmarkIsPalindrome.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - enable true diff --git a/exercises/practice/pangram/.articles/performance/code/Benchmark_Csharp.csproj b/exercises/practice/pangram/.articles/performance/code/Benchmark_Csharp.csproj index 3e9d5d040a..2ec2bf993c 100644 --- a/exercises/practice/pangram/.articles/performance/code/Benchmark_Csharp.csproj +++ b/exercises/practice/pangram/.articles/performance/code/Benchmark_Csharp.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - enable true diff --git a/exercises/practice/protein-translation/.articles/performance/code/Benchmark_Csharp.csproj b/exercises/practice/protein-translation/.articles/performance/code/Benchmark_Csharp.csproj index 3e9d5d040a..2ec2bf993c 100644 --- a/exercises/practice/protein-translation/.articles/performance/code/Benchmark_Csharp.csproj +++ b/exercises/practice/protein-translation/.articles/performance/code/Benchmark_Csharp.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - enable true diff --git a/exercises/practice/raindrops/.articles/performance/code/Benchmark_Csharp.csproj b/exercises/practice/raindrops/.articles/performance/code/Benchmark_Csharp.csproj index 3e9d5d040a..2ec2bf993c 100644 --- a/exercises/practice/raindrops/.articles/performance/code/Benchmark_Csharp.csproj +++ b/exercises/practice/raindrops/.articles/performance/code/Benchmark_Csharp.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - enable true diff --git a/exercises/practice/sieve/.articles/performance/code/Benchmark.csproj b/exercises/practice/sieve/.articles/performance/code/Benchmark.csproj index 3e9d5d040a..2ec2bf993c 100644 --- a/exercises/practice/sieve/.articles/performance/code/Benchmark.csproj +++ b/exercises/practice/sieve/.articles/performance/code/Benchmark.csproj @@ -5,7 +5,6 @@ net9.0 enable enable - enable true diff --git a/exercises/practice/simple-linked-list/SimpleLinkedListTests.cs b/exercises/practice/simple-linked-list/SimpleLinkedListTests.cs index c29fbb74b3..376ee37a79 100644 --- a/exercises/practice/simple-linked-list/SimpleLinkedListTests.cs +++ b/exercises/practice/simple-linked-list/SimpleLinkedListTests.cs @@ -12,7 +12,7 @@ public void Empty_list_has_no_elements() Assert.Equal(0, list.Count); } - [Fact()] + [Fact(Skip = "Remove this Skip property to run this test")] public void Count_cannot_be_changed_from_the_outside() { var count = typeof(SimpleLinkedList<>).GetProperty("Count"); @@ -21,7 +21,7 @@ public void Count_cannot_be_changed_from_the_outside() Assert.False(count.GetSetMethod(true) is { IsPublic: true }); } - [Fact()] + [Fact(Skip = "Remove this Skip property to run this test")] public void Pushing_elements_to_the_list_increases_the_count() { var list = new SimpleLinkedList(); @@ -31,7 +31,7 @@ public void Pushing_elements_to_the_list_increases_the_count() Assert.Equal(2, list.Count); } - [Fact()] + [Fact(Skip = "Remove this Skip property to run this test")] public void Popping_elements_from_the_list_decreases_the_count() { var list = new SimpleLinkedList(); @@ -42,7 +42,7 @@ public void Popping_elements_from_the_list_decreases_the_count() Assert.Equal(1, list.Count); } - [Fact()] + [Fact(Skip = "Remove this Skip property to run this test")] public void Elements_pop_back_in_lifo_order() { var list = new SimpleLinkedList(); @@ -70,7 +70,7 @@ private static SimpleLinkedList CreateSimpleLinkedList(params int[] values) return (SimpleLinkedList)constructor.Invoke([values]); } - [Fact()] + [Fact(Skip = "Remove this Skip property to run this test")] public void Single_value_initialisation() { var list = CreateSimpleLinkedList(7); @@ -78,7 +78,7 @@ public void Single_value_initialisation() Assert.Equal(7, list.Pop()); } - [Fact()] + [Fact(Skip = "Remove this Skip property to run this test")] public void Multi_value_initialisation() { var list = CreateSimpleLinkedList(2, 1, 3); @@ -87,7 +87,7 @@ public void Multi_value_initialisation() Assert.Equal(2, list.Pop()); } - [Fact()] + [Fact(Skip = "Remove this Skip property to run this test")] public void From_enumerable() { var list = CreateSimpleLinkedList(new[] { 11, 7, 5, 3, 2 }); @@ -98,7 +98,7 @@ public void From_enumerable() Assert.Equal(11, list.Pop()); } - [Fact()] + [Fact(Skip = "Remove this Skip property to run this test")] public void Reverse_enumerable() { var values = Enumerable.Range(1, 5).ToArray(); @@ -108,7 +108,7 @@ public void Reverse_enumerable() Assert.Equal(values, reversed); } - [Fact()] + [Fact(Skip = "Remove this Skip property to run this test")] public void Roundtrip() { var values = Enumerable.Range(1, 7); From 5b59b0cce773a117a79da2806e766641df272e7c Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Tue, 18 Feb 2025 16:57:42 +0100 Subject: [PATCH 32/32] remote-control: fix --- .../.meta/Exemplar.cs | 2 +- .../RemoteControlCompetition.cs | 23 +++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/exercises/concept/remote-control-competition/.meta/Exemplar.cs b/exercises/concept/remote-control-competition/.meta/Exemplar.cs index 8ce1b2ef67..70e892824c 100644 --- a/exercises/concept/remote-control-competition/.meta/Exemplar.cs +++ b/exercises/concept/remote-control-competition/.meta/Exemplar.cs @@ -17,7 +17,7 @@ public void Drive() DistanceTravelled += 10; } - public int CompareTo(ProductionRemoteControlCar other) + public int CompareTo(ProductionRemoteControlCar? other) { if (ReferenceEquals(this, other)) return 0; if (ReferenceEquals(null, other)) return 1; diff --git a/exercises/concept/remote-control-competition/RemoteControlCompetition.cs b/exercises/concept/remote-control-competition/RemoteControlCompetition.cs index 5602457519..70e892824c 100644 --- a/exercises/concept/remote-control-competition/RemoteControlCompetition.cs +++ b/exercises/concept/remote-control-competition/RemoteControlCompetition.cs @@ -1,9 +1,13 @@ using System; using System.Collections.Generic; -// TODO implement the IRemoteControlCar interface +public interface IRemoteControlCar +{ + void Drive(); + int DistanceTravelled { get; } +} -public class ProductionRemoteControlCar +public class ProductionRemoteControlCar : IRemoteControlCar, IComparable { public int DistanceTravelled { get; private set; } public int NumberOfVictories { get; set; } @@ -12,9 +16,16 @@ public void Drive() { DistanceTravelled += 10; } + + public int CompareTo(ProductionRemoteControlCar? other) + { + if (ReferenceEquals(this, other)) return 0; + if (ReferenceEquals(null, other)) return 1; + return NumberOfVictories.CompareTo(other.NumberOfVictories); + } } -public class ExperimentalRemoteControlCar +public class ExperimentalRemoteControlCar : IRemoteControlCar { public int DistanceTravelled { get; private set; } @@ -28,12 +39,14 @@ public static class TestTrack { public static void Race(IRemoteControlCar car) { - throw new NotImplementedException($"Please implement the (static) TestTrack.Race() method"); + car.Drive(); } public static List GetRankedCars(ProductionRemoteControlCar prc1, ProductionRemoteControlCar prc2) { - throw new NotImplementedException($"Please implement the (static) TestTrack.GetRankedCars() method"); + var rankings = new List { prc1, prc2 }; + rankings.Sort(); + return rankings; } }