trackler 2.0.8.14 → 2.0.8.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/common/exercises/robot-simulator/canonical-data.json +238 -214
- data/common/exercises/secret-handshake/canonical-data.json +80 -64
- data/lib/trackler/version.rb +1 -1
- data/tracks/csharp/.gitignore +6 -1
- data/tracks/csharp/.travis.yml +26 -3
- data/tracks/csharp/Zipper.cs +137 -0
- data/tracks/csharp/appveyor.yml +6 -1
- data/tracks/csharp/build.fsx +59 -47
- data/tracks/csharp/circle.yml +15 -5
- data/tracks/csharp/docs/INSTALLATION.md +12 -177
- data/tracks/csharp/docs/TESTS.md +21 -38
- data/tracks/csharp/exercises/accumulate/Accumulate.cs +10 -0
- data/tracks/csharp/exercises/accumulate/Accumulate.csproj +18 -0
- data/tracks/csharp/exercises/accumulate/AccumulateTest.cs +16 -27
- data/tracks/csharp/exercises/acronym/Acronym.cs +9 -0
- data/tracks/csharp/exercises/acronym/Acronym.csproj +18 -0
- data/tracks/csharp/exercises/acronym/AcronymTest.cs +17 -20
- data/tracks/csharp/exercises/acronym/Example.cs +11 -14
- data/tracks/csharp/exercises/all-your-base/AllYourBase.cs +9 -0
- data/tracks/csharp/exercises/all-your-base/AllYourBase.csproj +18 -0
- data/tracks/csharp/exercises/all-your-base/AllYourBaseTest.cs +30 -51
- data/tracks/csharp/exercises/allergies/Allergies.cs +19 -0
- data/tracks/csharp/exercises/allergies/Allergies.csproj +18 -0
- data/tracks/csharp/exercises/allergies/AllergiesTest.cs +28 -40
- data/tracks/csharp/exercises/alphametics/Alphametics.cs +10 -0
- data/tracks/csharp/exercises/alphametics/Alphametics.csproj +19 -0
- data/tracks/csharp/exercises/alphametics/AlphameticsTest.cs +18 -24
- data/tracks/csharp/exercises/alphametics/Example.cs +6 -1
- data/tracks/csharp/exercises/anagram/Anagram.cs +14 -0
- data/tracks/csharp/exercises/anagram/Anagram.csproj +18 -0
- data/tracks/csharp/exercises/anagram/AnagramTest.cs +19 -28
- data/tracks/csharp/exercises/atbash-cipher/AtbashCipher.cs +9 -0
- data/tracks/csharp/exercises/atbash-cipher/AtbashCipher.csproj +18 -0
- data/tracks/csharp/exercises/atbash-cipher/AtbashTest.cs +11 -11
- data/tracks/csharp/exercises/atbash-cipher/Example.cs +1 -1
- data/tracks/csharp/exercises/bank-account/BankAccount.cs +27 -0
- data/tracks/csharp/exercises/bank-account/BankAccount.csproj +18 -0
- data/tracks/csharp/exercises/bank-account/BankAccountTest.cs +14 -18
- data/tracks/csharp/exercises/beer-song/BeerSong.cs +14 -0
- data/tracks/csharp/exercises/beer-song/BeerSong.csproj +18 -0
- data/tracks/csharp/exercises/beer-song/BeerTest.cs +13 -11
- data/tracks/csharp/exercises/binary-search-tree/BinarySearchTree.cs +53 -0
- data/tracks/csharp/exercises/binary-search-tree/BinarySearchTree.csproj +18 -0
- data/tracks/csharp/exercises/binary-search-tree/BinarySearchTreeTest.cs +28 -36
- data/tracks/csharp/exercises/binary-search/BinarySearch.cs +9 -0
- data/tracks/csharp/exercises/binary-search/BinarySearch.csproj +18 -0
- data/tracks/csharp/exercises/binary-search/BinarySearchTest.cs +19 -28
- data/tracks/csharp/exercises/bob/Bob.cs +9 -0
- data/tracks/csharp/exercises/bob/Bob.csproj +18 -0
- data/tracks/csharp/exercises/bob/BobTest.cs +37 -55
- data/tracks/csharp/exercises/bob/Example.cs +2 -3
- data/tracks/csharp/exercises/book-store/BookStore.cs +10 -0
- data/tracks/csharp/exercises/book-store/BookStore.csproj +18 -0
- data/tracks/csharp/exercises/book-store/BookStoreTest.cs +25 -37
- data/tracks/csharp/exercises/book-store/Example.cs +1 -1
- data/tracks/csharp/exercises/bowling/Bowling.cs +14 -0
- data/tracks/csharp/exercises/bowling/Bowling.csproj +18 -0
- data/tracks/csharp/exercises/bowling/BowlingTest.cs +49 -72
- data/tracks/csharp/exercises/bracket-push/BracketPush.cs +9 -0
- data/tracks/csharp/exercises/bracket-push/BracketPush.csproj +18 -0
- data/tracks/csharp/exercises/bracket-push/BracketPushTest.cs +25 -36
- data/tracks/csharp/exercises/change/Change.cs +9 -0
- data/tracks/csharp/exercises/change/Change.csproj +18 -0
- data/tracks/csharp/exercises/change/ChangeTest.cs +15 -22
- data/tracks/csharp/exercises/circular-buffer/CircularBuffer.cs +29 -0
- data/tracks/csharp/exercises/circular-buffer/CircularBuffer.csproj +18 -0
- data/tracks/csharp/exercises/circular-buffer/CircularBufferTest.cs +36 -43
- data/tracks/csharp/exercises/clock/Clock.cs +24 -0
- data/tracks/csharp/exercises/clock/Clock.csproj +18 -0
- data/tracks/csharp/exercises/clock/ClockTest.cs +35 -48
- data/tracks/csharp/exercises/connect/Connect.cs +21 -0
- data/tracks/csharp/exercises/connect/Connect.csproj +18 -0
- data/tracks/csharp/exercises/connect/ConnectTest.cs +17 -24
- data/tracks/csharp/exercises/connect/Example.cs +36 -37
- data/tracks/csharp/exercises/crypto-square/CryptoSquare.cs +41 -0
- data/tracks/csharp/exercises/crypto-square/CryptoSquare.csproj +18 -0
- data/tracks/csharp/exercises/crypto-square/CryptoSquareTest.cs +33 -49
- data/tracks/csharp/exercises/custom-set/CustomSet.cs +88 -0
- data/tracks/csharp/exercises/custom-set/CustomSet.csproj +18 -0
- data/tracks/csharp/exercises/custom-set/CustomSetTest.cs +75 -111
- data/tracks/csharp/exercises/custom-set/Example.cs +20 -2
- data/tracks/csharp/exercises/diamond/Diamond.cs +9 -0
- data/tracks/csharp/exercises/diamond/Diamond.csproj +18 -0
- data/tracks/csharp/exercises/diamond/DiamondTest.cs +35 -26
- data/tracks/csharp/exercises/difference-of-squares/DifferenceOfSquares.cs +19 -0
- data/tracks/csharp/exercises/difference-of-squares/DifferenceOfSquares.csproj +18 -0
- data/tracks/csharp/exercises/difference-of-squares/DifferenceOfSquaresTest.cs +21 -38
- data/tracks/csharp/exercises/difference-of-squares/Example.cs +5 -17
- data/tracks/csharp/exercises/diffie-hellman/DiffieHellman.cs +20 -0
- data/tracks/csharp/exercises/diffie-hellman/DiffieHellman.csproj +18 -0
- data/tracks/csharp/exercises/diffie-hellman/DiffieHellmanTest.cs +16 -18
- data/tracks/csharp/exercises/dominoes/Dominoes.cs +10 -0
- data/tracks/csharp/exercises/dominoes/Dominoes.csproj +18 -0
- data/tracks/csharp/exercises/dominoes/DominoesTest.cs +35 -46
- data/tracks/csharp/exercises/dot-dsl/DotDsl.cs +15 -0
- data/tracks/csharp/exercises/dot-dsl/DotDsl.csproj +18 -0
- data/tracks/csharp/exercises/dot-dsl/DotDslTest.cs +40 -30
- data/tracks/csharp/exercises/error-handling/ErrorHandling.cs +24 -0
- data/tracks/csharp/exercises/error-handling/ErrorHandling.csproj +18 -0
- data/tracks/csharp/exercises/error-handling/ErrorHandlingTest.cs +12 -16
- data/tracks/csharp/exercises/etl/ETLTest.cs +9 -13
- data/tracks/csharp/exercises/etl/Etl.cs +10 -0
- data/tracks/csharp/exercises/etl/Etl.csproj +18 -0
- data/tracks/csharp/exercises/etl/Example.cs +1 -1
- data/tracks/csharp/exercises/exercises.sln +1475 -0
- data/tracks/csharp/exercises/flatten-array/FlattenArray.cs +10 -0
- data/tracks/csharp/exercises/flatten-array/FlattenArray.csproj +18 -0
- data/tracks/csharp/exercises/flatten-array/FlattenArrayTest.cs +18 -22
- data/tracks/csharp/exercises/food-chain/FoodChain.cs +14 -0
- data/tracks/csharp/exercises/food-chain/FoodChain.csproj +18 -0
- data/tracks/csharp/exercises/food-chain/FoodChainTest.cs +11 -15
- data/tracks/csharp/exercises/forth/Forth.cs +27 -0
- data/tracks/csharp/exercises/forth/Forth.csproj +19 -0
- data/tracks/csharp/exercises/forth/ForthTest.cs +42 -56
- data/tracks/csharp/exercises/gigasecond/Example.cs +1 -1
- data/tracks/csharp/exercises/gigasecond/Gigasecond.cs +9 -0
- data/tracks/csharp/exercises/gigasecond/Gigasecond.csproj +18 -0
- data/tracks/csharp/exercises/gigasecond/GigasecondTest.cs +7 -10
- data/tracks/csharp/exercises/go-counting/Example.cs +44 -44
- data/tracks/csharp/exercises/go-counting/GoCounting.cs +27 -0
- data/tracks/csharp/exercises/go-counting/GoCounting.csproj +18 -0
- data/tracks/csharp/exercises/go-counting/GoCountingTest.cs +53 -41
- data/tracks/csharp/exercises/grade-school/Example.cs +12 -14
- data/tracks/csharp/exercises/grade-school/GradeSchool.cs +20 -0
- data/tracks/csharp/exercises/grade-school/GradeSchool.csproj +18 -0
- data/tracks/csharp/exercises/grade-school/GradeSchoolTest.cs +21 -41
- data/tracks/csharp/exercises/grains/Example.cs +1 -1
- data/tracks/csharp/exercises/grains/Grains.cs +14 -0
- data/tracks/csharp/exercises/grains/Grains.csproj +18 -0
- data/tracks/csharp/exercises/grains/GrainsTest.cs +17 -25
- data/tracks/csharp/exercises/grep/Grep.cs +9 -0
- data/tracks/csharp/exercises/grep/Grep.csproj +18 -0
- data/tracks/csharp/exercises/grep/GrepTest.cs +62 -79
- data/tracks/csharp/exercises/hamming/Example.cs +2 -15
- data/tracks/csharp/exercises/hamming/Hamming.cs +9 -0
- data/tracks/csharp/exercises/hamming/Hamming.csproj +18 -0
- data/tracks/csharp/exercises/hamming/HammingTest.cs +13 -19
- data/tracks/csharp/exercises/hangman/Example.cs +11 -11
- data/tracks/csharp/exercises/hangman/Hangman.cs +34 -0
- data/tracks/csharp/exercises/hangman/Hangman.csproj +18 -0
- data/tracks/csharp/exercises/hangman/HangmanTest.cs +37 -42
- data/tracks/csharp/exercises/hello-world/HelloWorld.cs +9 -0
- data/tracks/csharp/exercises/hello-world/HelloWorld.csproj +18 -0
- data/tracks/csharp/exercises/hello-world/HelloWorldTest.cs +3 -4
- data/tracks/csharp/exercises/house/House.cs +9 -0
- data/tracks/csharp/exercises/house/House.csproj +18 -0
- data/tracks/csharp/exercises/house/HouseTest.cs +3 -3
- data/tracks/csharp/exercises/isogram/Isogram.cs +9 -0
- data/tracks/csharp/exercises/isogram/Isogram.csproj +18 -0
- data/tracks/csharp/exercises/isogram/IsogramTest.cs +14 -14
- data/tracks/csharp/exercises/kindergarten-garden/KinderGartenGardenTest.cs +28 -33
- data/tracks/csharp/exercises/kindergarten-garden/KindergartenGarden.cs +27 -0
- data/tracks/csharp/exercises/kindergarten-garden/KindergartenGarden.csproj +18 -0
- data/tracks/csharp/exercises/largest-series-product/LargestSeriesProduct.cs +9 -0
- data/tracks/csharp/exercises/largest-series-product/LargestSeriesProduct.csproj +18 -0
- data/tracks/csharp/exercises/largest-series-product/LargestSeriesProductTest.cs +31 -48
- data/tracks/csharp/exercises/leap/Leap.cs +9 -0
- data/tracks/csharp/exercises/leap/Leap.csproj +18 -0
- data/tracks/csharp/exercises/leap/LeapTest.cs +9 -13
- data/tracks/csharp/exercises/ledger/Example.cs +16 -5
- data/tracks/csharp/exercises/ledger/Ledger.cs +4 -1
- data/tracks/csharp/exercises/ledger/Ledger.csproj +18 -0
- data/tracks/csharp/exercises/ledger/LedgerTest.cs +21 -21
- data/tracks/csharp/exercises/linked-list/LinkedList.cs +24 -0
- data/tracks/csharp/exercises/linked-list/LinkedList.csproj +18 -0
- data/tracks/csharp/exercises/linked-list/LinkedListTest.cs +34 -42
- data/tracks/csharp/exercises/list-ops/ListOps.cs +46 -0
- data/tracks/csharp/exercises/list-ops/ListOps.csproj +18 -0
- data/tracks/csharp/exercises/list-ops/ListOpsTest.cs +50 -73
- data/tracks/csharp/exercises/luhn/Luhn.cs +9 -0
- data/tracks/csharp/exercises/luhn/Luhn.csproj +18 -0
- data/tracks/csharp/exercises/luhn/LuhnTest.cs +10 -10
- data/tracks/csharp/exercises/markdown/Markdown.csproj +18 -0
- data/tracks/csharp/exercises/markdown/MarkdownTest.cs +19 -19
- data/tracks/csharp/exercises/matrix/Matrix.cs +34 -0
- data/tracks/csharp/exercises/matrix/Matrix.csproj +18 -0
- data/tracks/csharp/exercises/matrix/MatrixTest.cs +42 -36
- data/tracks/csharp/exercises/meetup/Meetup.cs +23 -0
- data/tracks/csharp/exercises/meetup/Meetup.csproj +18 -0
- data/tracks/csharp/exercises/meetup/MeetupTest.cs +61 -61
- data/tracks/csharp/exercises/minesweeper/Minesweeper.cs +9 -0
- data/tracks/csharp/exercises/minesweeper/Minesweeper.csproj +18 -0
- data/tracks/csharp/exercises/minesweeper/MinesweeperTest.cs +15 -22
- data/tracks/csharp/exercises/nth-prime/NthPrime.cs +11 -0
- data/tracks/csharp/exercises/nth-prime/NthPrime.csproj +18 -0
- data/tracks/csharp/exercises/nth-prime/NthPrimeTest.cs +15 -14
- data/tracks/csharp/exercises/nucleotide-count/NucleotideCount.cs +24 -0
- data/tracks/csharp/exercises/nucleotide-count/NucleotideCount.csproj +18 -0
- data/tracks/csharp/exercises/nucleotide-count/NucleotideCountTest.cs +16 -24
- data/tracks/csharp/exercises/ocr-numbers/OcrNumbers.cs +9 -0
- data/tracks/csharp/exercises/ocr-numbers/OcrNumbers.csproj +18 -0
- data/tracks/csharp/exercises/ocr-numbers/OcrNumbersTest.cs +31 -45
- data/tracks/csharp/exercises/palindrome-products/PalindromeProducts.cs +42 -0
- data/tracks/csharp/exercises/palindrome-products/PalindromeProducts.csproj +18 -0
- data/tracks/csharp/exercises/palindrome-products/PalindromeTest.cs +25 -32
- data/tracks/csharp/exercises/pangram/Pangram.cs +9 -0
- data/tracks/csharp/exercises/pangram/Pangram.csproj +18 -0
- data/tracks/csharp/exercises/pangram/PangramTest.cs +21 -31
- data/tracks/csharp/exercises/parallel-letter-frequency/ParallelLetterFrequency.cs +10 -0
- data/tracks/csharp/exercises/parallel-letter-frequency/ParallelLetterFrequency.csproj +18 -0
- data/tracks/csharp/exercises/parallel-letter-frequency/ParallelLetterFrequencyTest.cs +17 -24
- data/tracks/csharp/exercises/pascals-triangle/PascalsTriangle.cs +10 -0
- data/tracks/csharp/exercises/pascals-triangle/PascalsTriangle.csproj +18 -0
- data/tracks/csharp/exercises/pascals-triangle/PascalsTriangleTest.cs +48 -20
- data/tracks/csharp/exercises/perfect-numbers/PerfectNumbers.cs +16 -0
- data/tracks/csharp/exercises/perfect-numbers/PerfectNumbers.csproj +18 -0
- data/tracks/csharp/exercises/perfect-numbers/PerfectNumbersTest.cs +16 -14
- data/tracks/csharp/exercises/phone-number/PhoneNumber.cs +24 -0
- data/tracks/csharp/exercises/phone-number/PhoneNumber.csproj +18 -0
- data/tracks/csharp/exercises/phone-number/PhoneNumberTest.cs +15 -22
- data/tracks/csharp/exercises/pig-latin/PigLatin.cs +9 -0
- data/tracks/csharp/exercises/pig-latin/PigLatin.csproj +18 -0
- data/tracks/csharp/exercises/pig-latin/PigLatinTest.cs +34 -43
- data/tracks/csharp/exercises/poker/Poker.cs +10 -0
- data/tracks/csharp/exercises/poker/Poker.csproj +18 -0
- data/tracks/csharp/exercises/poker/PokerTest.cs +40 -61
- data/tracks/csharp/exercises/pov/Pov.cs +43 -0
- data/tracks/csharp/exercises/pov/Pov.csproj +18 -0
- data/tracks/csharp/exercises/pov/PovTest.cs +24 -30
- data/tracks/csharp/exercises/prime-factors/PrimeFactors.cs +9 -0
- data/tracks/csharp/exercises/prime-factors/PrimeFactors.csproj +18 -0
- data/tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs +23 -34
- data/tracks/csharp/exercises/protein-translation/ProteinTranslation.cs +9 -0
- data/tracks/csharp/exercises/protein-translation/ProteinTranslation.csproj +18 -0
- data/tracks/csharp/exercises/protein-translation/ProteinTranslationTest.cs +37 -35
- data/tracks/csharp/exercises/proverb/Proverb.cs +14 -0
- data/tracks/csharp/exercises/proverb/Proverb.csproj +18 -0
- data/tracks/csharp/exercises/proverb/ProverbTest.cs +9 -12
- data/tracks/csharp/exercises/pythagorean-triplet/PythagoreanTriplet.cs +29 -0
- data/tracks/csharp/exercises/pythagorean-triplet/PythagoreanTriplet.csproj +18 -0
- data/tracks/csharp/exercises/pythagorean-triplet/PythagoreanTripletTest.cs +16 -21
- data/tracks/csharp/exercises/queen-attack/Example.cs +5 -14
- data/tracks/csharp/exercises/queen-attack/QueenAttack.cs +21 -0
- data/tracks/csharp/exercises/queen-attack/QueenAttack.csproj +18 -0
- data/tracks/csharp/exercises/queen-attack/QueenAttackTest.cs +17 -31
- data/tracks/csharp/exercises/rail-fence-cipher/RailFenceCipher.cs +18 -0
- data/tracks/csharp/exercises/rail-fence-cipher/RailFenceCipher.csproj +18 -0
- data/tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs +13 -18
- data/tracks/csharp/exercises/raindrops/Raindrops.cs +9 -0
- data/tracks/csharp/exercises/raindrops/Raindrops.csproj +18 -0
- data/tracks/csharp/exercises/raindrops/RaindropsTest.cs +29 -29
- data/tracks/csharp/exercises/react/React.cs +28 -0
- data/tracks/csharp/exercises/react/React.csproj +18 -0
- data/tracks/csharp/exercises/react/ReactTest.cs +24 -30
- data/tracks/csharp/exercises/rectangles/Example.cs +18 -19
- data/tracks/csharp/exercises/rectangles/Rectangles.cs +9 -0
- data/tracks/csharp/exercises/rectangles/Rectangles.csproj +18 -0
- data/tracks/csharp/exercises/rectangles/RectanglesTest.cs +21 -30
- data/tracks/csharp/exercises/rna-transcription/RnaTranscription.cs +9 -0
- data/tracks/csharp/exercises/rna-transcription/RnaTranscription.csproj +18 -0
- data/tracks/csharp/exercises/rna-transcription/RnaTranscriptionTest.cs +34 -0
- data/tracks/csharp/exercises/robot-name/RobotName.cs +17 -0
- data/tracks/csharp/exercises/robot-name/RobotName.csproj +18 -0
- data/tracks/csharp/exercises/robot-name/RobotNameTest.cs +10 -20
- data/tracks/csharp/exercises/robot-simulator/RobotSimulator.cs +64 -0
- data/tracks/csharp/exercises/robot-simulator/RobotSimulator.csproj +18 -0
- data/tracks/csharp/exercises/robot-simulator/RobotSimulatorTest.cs +19 -24
- data/tracks/csharp/exercises/roman-numerals/RomanNumerals.cs +9 -0
- data/tracks/csharp/exercises/roman-numerals/RomanNumerals.csproj +18 -0
- data/tracks/csharp/exercises/roman-numerals/RomanNumeralsTest.cs +23 -23
- data/tracks/csharp/exercises/run-length-encoding/RunLengthEncoding.cs +14 -0
- data/tracks/csharp/exercises/run-length-encoding/RunLengthEncoding.csproj +18 -0
- data/tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs +15 -21
- data/tracks/csharp/exercises/saddle-points/SaddlePointTest.cs +11 -15
- data/tracks/csharp/exercises/saddle-points/SaddlePoints.cs +15 -0
- data/tracks/csharp/exercises/saddle-points/SaddlePoints.csproj +18 -0
- data/tracks/csharp/exercises/say/Example.cs +1 -1
- data/tracks/csharp/exercises/say/Say.cs +9 -0
- data/tracks/csharp/exercises/say/Say.csproj +18 -0
- data/tracks/csharp/exercises/say/SayTest.cs +34 -48
- data/tracks/csharp/exercises/scale-generator/Example.cs +1 -1
- data/tracks/csharp/exercises/scale-generator/ScaleGenerator.cs +9 -0
- data/tracks/csharp/exercises/scale-generator/ScaleGenerator.csproj +18 -0
- data/tracks/csharp/exercises/scale-generator/ScaleGeneratorTest.cs +29 -42
- data/tracks/csharp/exercises/scrabble-score/ScrabbleScore.cs +9 -0
- data/tracks/csharp/exercises/scrabble-score/ScrabbleScore.csproj +18 -0
- data/tracks/csharp/exercises/scrabble-score/ScrabbleScoreTest.cs +19 -28
- data/tracks/csharp/exercises/secret-handshake/SecretHandshake.cs +10 -0
- data/tracks/csharp/exercises/secret-handshake/SecretHandshake.csproj +18 -0
- data/tracks/csharp/exercises/secret-handshake/SecretHandshakeTest.cs +15 -22
- data/tracks/csharp/exercises/series/Series.cs +13 -0
- data/tracks/csharp/exercises/series/Series.csproj +18 -0
- data/tracks/csharp/exercises/series/SeriesTest.cs +26 -25
- data/tracks/csharp/exercises/sgf-parsing/Example.cs +11 -1
- data/tracks/csharp/exercises/sgf-parsing/SgfParsing.cs +12 -3
- data/tracks/csharp/exercises/sgf-parsing/SgfParsing.csproj +19 -0
- data/tracks/csharp/exercises/sgf-parsing/SgfParsingTest.cs +27 -37
- data/tracks/csharp/exercises/sieve/Sieve.cs +9 -0
- data/tracks/csharp/exercises/sieve/Sieve.csproj +18 -0
- data/tracks/csharp/exercises/sieve/SieveTest.cs +8 -12
- data/tracks/csharp/exercises/simple-cipher/SimpleCipher.cs +32 -0
- data/tracks/csharp/exercises/simple-cipher/SimpleCipher.csproj +18 -0
- data/tracks/csharp/exercises/simple-cipher/SimpleCipherTest.cs +44 -75
- data/tracks/csharp/exercises/simple-linked-list/SimpleLinkedList.cs +48 -0
- data/tracks/csharp/exercises/simple-linked-list/SimpleLinkedList.csproj +18 -0
- data/tracks/csharp/exercises/simple-linked-list/SimpleLinkedListTest.cs +31 -35
- data/tracks/csharp/exercises/space-age/Example.cs +21 -21
- data/tracks/csharp/exercises/space-age/SpaceAge.cs +48 -0
- data/tracks/csharp/exercises/space-age/SpaceAge.csproj +18 -0
- data/tracks/csharp/exercises/space-age/SpaceAgeTest.cs +24 -41
- data/tracks/csharp/exercises/strain/Strain.cs +15 -0
- data/tracks/csharp/exercises/strain/Strain.csproj +18 -0
- data/tracks/csharp/exercises/strain/StrainTest.cs +25 -37
- data/tracks/csharp/exercises/sublist/Sublist.cs +19 -0
- data/tracks/csharp/exercises/sublist/Sublist.csproj +18 -0
- data/tracks/csharp/exercises/sublist/SublistTest.cs +37 -54
- data/tracks/csharp/exercises/sum-of-multiples/SumOfMultiples.cs +10 -0
- data/tracks/csharp/exercises/sum-of-multiples/SumOfMultiples.csproj +18 -0
- data/tracks/csharp/exercises/sum-of-multiples/SumOfMultiplesTest.cs +15 -22
- data/tracks/csharp/exercises/tournament/Tournament.cs +10 -0
- data/tracks/csharp/exercises/tournament/Tournament.csproj +18 -0
- data/tracks/csharp/exercises/tournament/TournamentTest.cs +10 -13
- data/tracks/csharp/exercises/transpose/Transpose.cs +9 -0
- data/tracks/csharp/exercises/transpose/Transpose.csproj +18 -0
- data/tracks/csharp/exercises/transpose/TransposeTest.cs +21 -30
- data/tracks/csharp/exercises/tree-building/TreeBuilding.csproj +18 -0
- data/tracks/csharp/exercises/tree-building/TreeBuildingTest.cs +27 -26
- data/tracks/csharp/exercises/triangle/Example.cs +1 -1
- data/tracks/csharp/exercises/triangle/Triangle.cs +18 -0
- data/tracks/csharp/exercises/triangle/Triangle.csproj +18 -0
- data/tracks/csharp/exercises/triangle/TriangleTest.cs +26 -41
- data/tracks/csharp/exercises/twelve-days/Example.cs +4 -4
- data/tracks/csharp/exercises/twelve-days/TwelveDays.cs +19 -0
- data/tracks/csharp/exercises/twelve-days/TwelveDays.csproj +18 -0
- data/tracks/csharp/exercises/twelve-days/TwelveDaysTest.cs +29 -51
- data/tracks/csharp/exercises/two-bucket/TwoBucket.cs +27 -0
- data/tracks/csharp/exercises/two-bucket/TwoBucket.csproj +18 -0
- data/tracks/csharp/exercises/two-bucket/TwoBucketTest.cs +17 -20
- data/tracks/csharp/exercises/variable-length-quantity/VariableLengthQuantity.cs +14 -0
- data/tracks/csharp/exercises/variable-length-quantity/VariableLengthQuantity.csproj +18 -0
- data/tracks/csharp/exercises/variable-length-quantity/VariableLengthQuantityTest.cs +40 -51
- data/tracks/csharp/exercises/word-count/Example.cs +1 -1
- data/tracks/csharp/exercises/word-count/WordCount.cs +10 -0
- data/tracks/csharp/exercises/word-count/WordCount.csproj +18 -0
- data/tracks/csharp/exercises/word-count/WordCountTest.cs +23 -34
- data/tracks/csharp/exercises/word-search/Example.cs +18 -20
- data/tracks/csharp/exercises/word-search/WordSearch.cs +16 -0
- data/tracks/csharp/exercises/word-search/WordSearch.csproj +18 -0
- data/tracks/csharp/exercises/word-search/WordSearchTest.cs +30 -31
- data/tracks/csharp/exercises/wordy/Example.cs +1 -1
- data/tracks/csharp/exercises/wordy/Wordy.cs +9 -0
- data/tracks/csharp/exercises/wordy/Wordy.csproj +18 -0
- data/tracks/csharp/exercises/wordy/WordyTest.cs +34 -49
- data/tracks/csharp/exercises/zebra-puzzle/ZebraPuzzle.cs +22 -0
- data/tracks/csharp/exercises/zebra-puzzle/ZebraPuzzle.csproj +18 -0
- data/tracks/csharp/exercises/zebra-puzzle/ZebraPuzzleTest.cs +5 -6
- data/tracks/csharp/exercises/zipper/Zipper.cs +64 -0
- data/tracks/csharp/exercises/zipper/Zipper.csproj +18 -0
- data/tracks/csharp/exercises/zipper/ZipperTest.cs +31 -29
- data/tracks/csharp/paket.dependencies +1 -5
- data/tracks/csharp/paket.lock +1 -78
- data/tracks/go/README.md +10 -3
- data/tracks/go/bin/test-without-stubs +1 -1
- data/tracks/go/docs/TESTS.md +7 -0
- data/tracks/go/exercises/beer-song/example.go +1 -1
- data/tracks/go/exercises/binary-search/binary_search_test.go +1 -1
- data/tracks/go/exercises/clock/example_clock_test.go +40 -0
- data/tracks/go/exercises/grade-school/grade_school_test.go +1 -1
- data/tracks/go/exercises/hello-world/hello_example_test.go +20 -0
- data/tracks/go/exercises/minesweeper/minesweeper_test.go +1 -1
- data/tracks/go/exercises/pov/pov_test.go +4 -1
- data/tracks/java/exercises/pangram/src/example/java/{Pangrams.java → PangramChecker.java} +5 -3
- data/tracks/java/exercises/pangram/src/main/java/PangramChecker.java +6 -0
- data/tracks/java/exercises/pangram/src/test/java/PangramCheckerTest.java +82 -0
- data/tracks/ocaml/exercises/run-length-encoding/test.ml +9 -1
- data/tracks/ocaml/tools/test-generator/src/parser.ml +1 -1
- data/tracks/ocaml/tools/test-generator/src/special_cases.ml +15 -7
- data/tracks/python/exercises/list-ops/example.py +6 -6
- data/tracks/python/exercises/list-ops/list_ops_test.py +22 -37
- data/tracks/typescript/.gitignore +1 -1
- data/tracks/typescript/config.json +12 -0
- data/tracks/typescript/exercises/etl/etl.example.ts +16 -0
- data/tracks/typescript/exercises/etl/etl.test.ts +48 -0
- data/tracks/typescript/exercises/etl/package.json +36 -0
- data/tracks/typescript/exercises/etl/tsconfig.json +21 -0
- data/tracks/typescript/exercises/etl/tslint.json +127 -0
- data/tracks/typescript/exercises/etl/yarn.lock +2739 -0
- data/tracks/typescript/exercises/robot-name/robot-name.example.ts +1 -1
- data/tracks/typescript/exercises/space-age/package.json +36 -0
- data/tracks/typescript/exercises/space-age/space-age.example.ts +21 -0
- data/tracks/typescript/exercises/space-age/space-age.test.ts +56 -0
- data/tracks/typescript/exercises/space-age/tsconfig.json +21 -0
- data/tracks/typescript/exercises/space-age/tslint.json +127 -0
- data/tracks/typescript/exercises/space-age/yarn.lock +2739 -0
- metadata +226 -26
- data/tracks/csharp/docs/img/AddFiles.png +0 -0
- data/tracks/csharp/docs/img/SolutionExplorer.png +0 -0
- data/tracks/csharp/docs/img/TestExplorer.png +0 -0
- data/tracks/csharp/docs/img/addNewClass.png +0 -0
- data/tracks/csharp/docs/img/createNewProject.png +0 -0
- data/tracks/csharp/docs/img/dragDropFolders.png +0 -0
- data/tracks/csharp/docs/img/nUnitExecuteTests.png +0 -0
- data/tracks/csharp/docs/img/nUnitRunner.png +0 -0
- data/tracks/csharp/docs/img/newProject.png +0 -0
- data/tracks/csharp/docs/img/nugetManageNunitRunner.png +0 -0
- data/tracks/csharp/docs/img/nugetMenu.png +0 -0
- data/tracks/csharp/docs/img/xamarin-add-new-project.png +0 -0
- data/tracks/csharp/docs/img/xamarin-add-reference.png +0 -0
- data/tracks/csharp/docs/img/xamarin-csharp.jpg +0 -0
- data/tracks/csharp/docs/img/xamarin-edit-reference.png +0 -0
- data/tracks/csharp/docs/img/xamarin-naming.png +0 -0
- data/tracks/csharp/docs/img/xamarin-nunit.jpg +0 -0
- data/tracks/csharp/docs/img/xamarin-tests.png +0 -0
- data/tracks/csharp/exercises/exercises.csproj +0 -363
- data/tracks/csharp/exercises/paket.references +0 -2
- data/tracks/csharp/exercises/rna-transcription/ComplementTest.cs +0 -39
- data/tracks/java/exercises/pangram/src/main/java/.keep +0 -0
- data/tracks/java/exercises/pangram/src/test/java/PangramsTest.java +0 -75
data/tracks/csharp/circle.yml
CHANGED
@@ -1,16 +1,26 @@
|
|
1
1
|
machine:
|
2
2
|
environment:
|
3
3
|
TERM: xterm-256color
|
4
|
+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
|
5
|
+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
4
6
|
dependencies:
|
5
7
|
pre:
|
8
|
+
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
6
9
|
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
|
7
10
|
- echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
|
8
11
|
- sudo apt-get update
|
9
12
|
- sudo apt-get install mono-complete
|
13
|
+
- sudo apt-get install gettext
|
14
|
+
- sudo apt-get install libcurl4-openssl-dev
|
15
|
+
- sudo apt-get install libicu-dev
|
16
|
+
- sudo apt-get install libssl-dev
|
17
|
+
- sudo apt-get install libunwind8
|
18
|
+
- sudo apt-get install zlib1g
|
19
|
+
- sudo apt-get install libstdc++6
|
20
|
+
- curl https://download.microsoft.com/download/B/4/6/B4678511-01F4-4F97-902B-0E58A985932A/dotnet-dev-debian-x64.1.0.0-rc4-004771.tar.gz -o /tmp/dotnet.tar.gz
|
21
|
+
- sudo mkdir -p /opt/dotnet
|
22
|
+
- sudo tar zxf /tmp/dotnet.tar.gz -C /opt/dotnet
|
23
|
+
- sudo ln -s /opt/dotnet/dotnet /usr/local/bin
|
10
24
|
test:
|
11
25
|
override:
|
12
|
-
- ./build.sh
|
13
|
-
post:
|
14
|
-
- mkdir -p $CIRCLE_TEST_REPORTS/junit/
|
15
|
-
- sed -i '1 s/^\xef\xbb\xbf//' .*/junit-results.xml
|
16
|
-
- find . -type f -regex ".*/junit-results.xml" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
|
26
|
+
- ./build.sh
|
@@ -1,185 +1,20 @@
|
|
1
|
-
|
1
|
+
### Installing .NET Core
|
2
2
|
|
3
|
-
|
4
|
-
* [Mac](#mac)
|
5
|
-
* [Linux](#linux)
|
6
|
-
|
7
|
-
### [Windows](#windows)
|
8
|
-
There are a couple of different ways to get started using C#. The main way is to
|
9
|
-
install Visual Studio, the IDE for C# and related projects.
|
10
|
-
|
11
|
-
If you don't want to use the IDE, files can be compiled via command line using the
|
12
|
-
compiler provided by the .NET framework.
|
13
|
-
|
14
|
-
#### With Visual Studio
|
15
|
-
|
16
|
-
Install [Visual Studio Express 2013 for Windows Desktop](http://www.visualstudio.com/downloads/download-visual-studio-vs#d-express-windows-desktop). This will include the IDE and compiler for C#.
|
17
|
-
|
18
|
-
You can either start by creating your own project for working with the Exercism problems or you can download a Visual Studio solution that is already set up.
|
19
|
-
|
20
|
-
#### Exercism.io Visual Studio Template
|
21
|
-
|
22
|
-
This is a Visual Studio template that comes pre-configured to work on the problems in as many languages as Visual Studio supports.
|
23
|
-
|
24
|
-
![Solution Explorer](http://x.exercism.io/v3/tracks/csharp/docs/img/SolutionExplorer.png)
|
25
|
-
|
26
|
-
1. Download the [Exercism.io Visual Studio Template](https://github.com/rprouse/Exercism.VisualStudio) from GitHub by clicking the Download Zip button on the page.
|
27
|
-
2. Unzip the template into your exercises directory, for example `C:\src\exercises`
|
28
|
-
2. Install the [Exercism CLI](http://exercism.io/cli)
|
29
|
-
3. Open a command prompt to your exercise directory
|
30
|
-
4. Add your API key to exercism `exercism configure --key=YOUR_API_KEY`
|
31
|
-
5. Configure your source directory in exercism `exercism configure --dir=C:\src\exercises`
|
32
|
-
6. [Fetch your first exercise](http://exercism.io/how-it-works/newbie) `exercism fetch csharp`
|
33
|
-
7. Open the Exercism solution in Visual Studio
|
34
|
-
8. Expand the Exercism.csharp project
|
35
|
-
9. Click on **Show All Files** in Solution Explorer (See below)
|
36
|
-
10. The exercise you just fetched will appear greyed out. Right click on the folder and **Include In Project**
|
37
|
-
11. Get coding...
|
38
|
-
|
39
|
-
![Add files](http://x.exercism.io/v3/tracks/csharp/docs/img/AddFiles.png)
|
40
|
-
|
41
|
-
The NUnit NuGet package is included in the project, so you will not need to install it.
|
42
|
-
|
43
|
-
If you have a paid version of Visual Studio install the [NUnit Visual Studio Test Adapter](https://visualstudiogallery.msdn.microsoft.com/6ab922d0-21c0-4f06-ab5f-4ecd1fe7175d). This will allow you to run the tests from within Visual Studio. If you have ReSharper installed, you can also [run the tests using ReSharper](https://www.jetbrains.com/resharper/features/unit_testing.html).
|
44
|
-
|
45
|
-
![Test Explorer](http://x.exercism.io/v3/tracks/csharp/docs/img/TestExplorer.png)
|
46
|
-
|
47
|
-
If you are using Visual Studio Express, install [NUnit 3.x](http://www.nunit.org/) and run the tests from the command line (see below).
|
48
|
-
|
49
|
-
#### Create a New Visual Studio Project
|
50
|
-
|
51
|
-
Once installed and started, click on "Create New Project" (alternatively, you can go to File->New->New Project).
|
52
|
-
|
53
|
-
![New Project](http://x.exercism.io/v3/tracks/csharp/docs/img/newProject.png)
|
54
|
-
|
55
|
-
Choose what language and project type (Visual C# and Class Library). Also name your project to whatever you'd like.
|
56
|
-
|
57
|
-
![Create Project](http://x.exercism.io/v3/tracks/csharp/docs/img/createNewProject.png)
|
58
|
-
|
59
|
-
Once created, feel free to drag and drop the C# Exercism folders into the project.
|
60
|
-
|
61
|
-
![Drag and Drop Folders](http://x.exercism.io/v3/tracks/csharp/docs/img/dragDropFolders.png)
|
62
|
-
|
63
|
-
In order to compile, get the [NUnit](http://nunit.org/) assembly referenced for the unit tests. This can be done via [NuGet](http://www.nuget.org/) - a package manager for Visual Studio. The best packages is to get the base [NUnit]() and the [NUnit.Console](https://www.nuget.org/packages/NUnit.Console/)
|
64
|
-
package since it includes the assemblies needed and a GUI test runner.
|
65
|
-
|
66
|
-
![Nuget](http://x.exercism.io/v3/tracks/csharp/docs/img/nugetMenu.png)
|
67
|
-
|
68
|
-
Two options to use Nuget - the NuGet manager or through the Package Manager Console.
|
69
|
-
|
70
|
-
The manager is the easiest way to get started.
|
71
|
-
|
72
|
-
![Nuget Manager](http://x.exercism.io/v3/tracks/csharp/docs/img/nugetManageNunitRunner.png)
|
73
|
-
|
74
|
-
The project should now be able to compile.
|
75
|
-
|
76
|
-
The next piece required is the NUnit Test Adapter for Visual Studio. The major version of the Test Adapter must match the major version of the NUnit Framework that you installed above, or the Visual Studio Test Explorer window will not detect your unit tests.
|
77
|
-
- [Adapter Version 3 for NUnit 3.x](https://visualstudiogallery.msdn.microsoft.com/0da0f6bd-9bb6-4ae3-87a8-537788622f2d)
|
78
|
-
- [Adapter Version 2 for NUnit 2.x](https://visualstudiogallery.msdn.microsoft.com/6ab922d0-21c0-4f06-ab5f-4ecd1fe7175d)
|
79
|
-
|
80
|
-
To start implementing the exercise, in Visual Studio, right click on where you want the file to go to and go to `Add` -> `Class`. Name it what you'd like.
|
81
|
-
|
82
|
-
![New Item](http://x.exercism.io/v3/tracks/csharp/docs/img/addNewClass.png)
|
83
|
-
|
84
|
-
Now you can start coding!
|
85
|
-
|
86
|
-
#### With the command line compiler
|
87
|
-
The .cs files can also be compiled without Visual Studio. Get the latest version of
|
88
|
-
[.NET installed](http://msdn.microsoft.com/en-us/library/5a4x27ek(v=vs.110).aspx) and there will be an executable called csc.exe.
|
89
|
-
|
90
|
-
The compiler executable is usually located in the Microsoft.NET\Framework\Version folder under the Windows directory.
|
91
|
-
|
92
|
-
Refer to this [MSDN article](http://msdn.microsoft.com/en-us/library/78f4aasd.aspx) for more information on the command line compiler.
|
93
|
-
|
94
|
-
### [Mac](#mac)
|
95
|
-
|
96
|
-
Install [Xamarin Studio](http://xamarin.com/download).
|
97
|
-
|
98
|
-
While Xamarin is most known for creating iOS and Android applications, it's still a perfect IDE to create C# console
|
99
|
-
or library projects which is all that's needed for Exercism.
|
100
|
-
|
101
|
-
Once installed and running, click on new solution and you'll find the C# library project to select.
|
102
|
-
|
103
|
-
![Xamarin New Project](http://x.exercism.io/v3/tracks/csharp/docs/img/xamarin-csharp.jpg)
|
104
|
-
|
105
|
-
### [Linux](#linux)
|
106
|
-
|
107
|
-
.NET Core is available for Linux. Follow the [official installation guide](https://www.microsoft.com/net/core#linuxubuntu) to install the .NET Core development tools.
|
108
|
-
|
109
|
-
After installing .NET Core, fetch the first exercise of the csharp-track:
|
110
|
-
|
111
|
-
```
|
112
|
-
exercism fetch csharp
|
113
|
-
```
|
114
|
-
|
115
|
-
Move into the exercise directory:
|
116
|
-
|
117
|
-
```
|
118
|
-
cd ~/exercism/csharp/hello-world
|
119
|
-
```
|
120
|
-
|
121
|
-
Initialize a new dotnet project
|
122
|
-
|
123
|
-
```
|
124
|
-
dotnet new
|
125
|
-
```
|
126
|
-
|
127
|
-
Several new files are created, among them project.json. We have to add nunit as a dependency in order to run the tests provided in the exercise.
|
128
|
-
|
129
|
-
Add the following lines to the dependency block:
|
3
|
+
The C# track is built on top of the [.NET Core](https://www.microsoft.com/net/core/platform) platform, which runs on Windows, Linux and macOS. To build .NET Core projects, you can use the .NET Core Command Line Interface (CLI). This CLI is part of the .NET Core SDK, which you can install by following the [installation instructions](https://www.microsoft.com/net/download/core). After completing the installation, you can verify if the CLI was installed succesfully by running this command in a terminal:
|
130
4
|
|
131
|
-
```
|
132
|
-
|
133
|
-
"nunit": "3.6.0",
|
134
|
-
"dotnet-test-nunit": "3.4.0-*"
|
135
|
-
}
|
5
|
+
```bash
|
6
|
+
dotnet --version
|
136
7
|
```
|
137
8
|
|
138
|
-
|
9
|
+
It the output is a version greater than or equal to `1.0.0`, the .NET Core SDK has been installed succesfully.
|
139
10
|
|
140
|
-
|
141
|
-
"testRunner":"nunit"
|
142
|
-
```
|
143
|
-
|
144
|
-
The complete **project.json** file should look something like this:
|
11
|
+
### Using an IDE
|
145
12
|
|
146
|
-
|
147
|
-
{
|
148
|
-
"version": "1.0.0-*",
|
149
|
-
"buildOptions": {
|
150
|
-
"debugType": "portable",
|
151
|
-
"emitEntryPoint": true
|
152
|
-
},
|
153
|
-
"dependencies": {
|
154
|
-
"nunit": "3.6.0",
|
155
|
-
"dotnet-test-nunit": "3.4.0-*"
|
156
|
-
},
|
157
|
-
"testRunner":"nunit",
|
158
|
-
"frameworks": {
|
159
|
-
"netcoreapp1.1": {
|
160
|
-
"dependencies": {
|
161
|
-
"Microsoft.NETCore.App": {
|
162
|
-
"type": "platform",
|
163
|
-
"version": "1.1.0"
|
164
|
-
}
|
165
|
-
},
|
166
|
-
"imports": "dnxcore50"
|
167
|
-
}
|
168
|
-
}
|
169
|
-
}
|
170
|
-
```
|
171
|
-
|
172
|
-
Then we can restore the packages using:
|
173
|
-
|
174
|
-
```
|
175
|
-
dotnet restore
|
176
|
-
```
|
177
|
-
|
178
|
-
Compile the project and run the tests with this:
|
179
|
-
|
180
|
-
```
|
181
|
-
dotnet test
|
182
|
-
```
|
13
|
+
If you want a more full-featured editing experience, you probably want to to use an IDE. These are the most popular IDE's that support building .NET Core projects:
|
183
14
|
|
15
|
+
* [Visual Studio 2017](https://www.visualstudio.com/downloads/)
|
16
|
+
* [Visual Studio Code](https://code.visualstudio.com/download) with the [C# extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp)
|
17
|
+
* [Visual Studio for Mac](https://www.visualstudio.com/vs/visual-studio-mac/) (still in beta)
|
18
|
+
* [Project Rider](https://www.jetbrains.com/rider/download/) (still in EAP)
|
184
19
|
|
185
|
-
|
20
|
+
Note: as the .NET Core project format differs significantly from earlier versions, older IDE's (like Visual Studio 2015 and Xamarin Studio) are not supported.
|
data/tracks/csharp/docs/TESTS.md
CHANGED
@@ -1,50 +1,33 @@
|
|
1
|
-
|
2
|
-
All tests have been ignored except the first one for you to work on. To continue, just remove the ```[Ignore]``` attribute on the test to start working on it.
|
1
|
+
## Running Tests
|
3
2
|
|
4
|
-
|
3
|
+
To run the tests, you first need to restore the project's dependencies using the following command:
|
5
4
|
|
6
|
-
|
5
|
+
```bash
|
6
|
+
dotnet restore
|
7
|
+
```
|
7
8
|
|
8
|
-
|
9
|
+
You can then run the tests by executing the following command:
|
9
10
|
|
10
|
-
|
11
|
+
```bash
|
12
|
+
dotnet test
|
13
|
+
```
|
11
14
|
|
12
|
-
|
15
|
+
## Solving the exercise
|
13
16
|
|
14
|
-
|
17
|
+
Solving an exercise means making all its tests pass. By default, only one test (the first one) is executed when you run the tests. This is intentional, as it allows you to focus on just making that one test pass. Once it passes, you can enable the next test by removing `Skip = "Remove to run test"` from the test's `[Fact]` or `[Theory]` attribute. When all tests have been enabled and your implementation makes them all pass, you'll have solved the exercise!
|
15
18
|
|
16
|
-
|
19
|
+
To help you get started, each exercise comes with a stub implementation file. You can use this file as a starting point for building your solution. Feel free to remove or change this file if you think it is the right thing to do.
|
17
20
|
|
18
|
-
|
21
|
+
## Using packages
|
19
22
|
|
20
|
-
|
23
|
+
You should be able to solve most exercises without using any external packages. However, for the exercises where you do want to use an external package, you can add it to your project by running the following command:
|
21
24
|
|
22
|
-
|
25
|
+
```bash
|
26
|
+
dotnet add package <package-name>
|
27
|
+
```
|
23
28
|
|
24
|
-
|
29
|
+
Once the package has been added, you need to update the project's dependencies again to use it in your project:
|
25
30
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
This is the example setup for the "leap" exercise. We assume you created a solution called `LeapCalculator`.
|
30
|
-
|
31
|
-
Right-click the solution and choose *Add* -> *Add New Project*.
|
32
|
-
![Add Xamarin NUnit Test](http://x.exercism.io/v3/tracks/csharp/docs/img/xamarin-add-new-project.png)
|
33
|
-
|
34
|
-
Then from the new project dialog, select an NUnit Library Project.
|
35
|
-
![Xamarin NUnit](http://x.exercism.io/v3/tracks/csharp/docs/img/xamarin-nunit.jpg)
|
36
|
-
|
37
|
-
For the project name append `.Tests` to the name of your solution. So in our case `LeapCalculator.Tests`
|
38
|
-
![Xamarin NUnit](http://x.exercism.io/v3/tracks/csharp/docs/img/xamarin-naming.png)
|
39
|
-
|
40
|
-
Set a reference to your solution with right-click on references in your test project. Then choose the Projects tab and tick the box to your solution and click `ok`.
|
41
|
-
|
42
|
-
![Xamarin NUnit](http://x.exercism.io/v3/tracks/csharp/docs/img/xamarin-edit-reference.png)
|
43
|
-
|
44
|
-
![Xamarin NUnit](http://x.exercism.io/v3/tracks/csharp/docs/img/xamarin-add-reference.png)
|
45
|
-
|
46
|
-
Add some of the tests from the exercise or write your own.
|
47
|
-
|
48
|
-
To run the tests open the `Unit Tests` pad within Xamarin (View -> Pads -> Unit Tests) and click `Run All`.
|
49
|
-
|
50
|
-
![Xamarin NUnit](http://x.exercism.io/v3/tracks/csharp/docs/img/xamarin-tests.png)
|
31
|
+
```bash
|
32
|
+
dotnet restore
|
33
|
+
```
|
@@ -0,0 +1,10 @@
|
|
1
|
+
using System;
|
2
|
+
using System.Collections.Generic;
|
3
|
+
|
4
|
+
public static class AccumulateExtensions
|
5
|
+
{
|
6
|
+
public static IEnumerable<U> Accumulate<T, U>(this IEnumerable<T> collection, Func<T, U> func)
|
7
|
+
{
|
8
|
+
throw new NotImplementedException("You need to implement this function.");
|
9
|
+
}
|
10
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
2
|
+
|
3
|
+
<PropertyGroup>
|
4
|
+
<OutputType>Exe</OutputType>
|
5
|
+
<TargetFramework>netcoreapp1.0</TargetFramework>
|
6
|
+
</PropertyGroup>
|
7
|
+
|
8
|
+
<ItemGroup>
|
9
|
+
<Compile Remove="Example.cs" />
|
10
|
+
</ItemGroup>
|
11
|
+
|
12
|
+
<ItemGroup>
|
13
|
+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
|
14
|
+
<PackageReference Include="xunit" Version="2.2.0" />
|
15
|
+
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
|
16
|
+
</ItemGroup>
|
17
|
+
|
18
|
+
</Project>
|
@@ -1,38 +1,32 @@
|
|
1
1
|
using System;
|
2
2
|
using System.Collections.Generic;
|
3
3
|
using System.Linq;
|
4
|
-
using
|
4
|
+
using Xunit;
|
5
5
|
|
6
|
-
[TestFixture]
|
7
6
|
public class AccumulateTest
|
8
7
|
{
|
9
|
-
[
|
8
|
+
[Fact]
|
10
9
|
public void Empty_accumulation_produces_empty_accumulation()
|
11
10
|
{
|
12
|
-
Assert.
|
11
|
+
Assert.Equal(new int[0], new int[0].Accumulate(x => x * x));
|
13
12
|
}
|
14
13
|
|
15
|
-
[
|
16
|
-
[Test]
|
14
|
+
[Fact(Skip = "Remove to run test")]
|
17
15
|
public void Accumulate_squares()
|
18
16
|
{
|
19
|
-
Assert.
|
17
|
+
Assert.Equal(new[] { 1, 4, 9 }, new[] { 1, 2, 3 }.Accumulate(x => x * x));
|
20
18
|
}
|
21
19
|
|
22
|
-
[
|
23
|
-
[Test]
|
20
|
+
[Fact(Skip = "Remove to run test")]
|
24
21
|
public void Accumulate_upcases()
|
25
22
|
{
|
26
|
-
Assert.
|
27
|
-
Is.EqualTo(new List<string> { "HELLO", "WORLD" }));
|
23
|
+
Assert.Equal(new List<string> { "HELLO", "WORLD" }, new List<string> { "hello", "world" }.Accumulate(x => x.ToUpper()));
|
28
24
|
}
|
29
25
|
|
30
|
-
[
|
31
|
-
[Test]
|
26
|
+
[Fact(Skip = "Remove to run test")]
|
32
27
|
public void Accumulate_reversed_strings()
|
33
28
|
{
|
34
|
-
Assert.
|
35
|
-
Is.EqualTo("eht kciuq nworb xof cte".Split(' ')));
|
29
|
+
Assert.Equal("eht kciuq nworb xof cte".Split(' '), "the quick brown fox etc".Split(' ').Accumulate(Reverse));
|
36
30
|
}
|
37
31
|
|
38
32
|
private static string Reverse(string value)
|
@@ -42,33 +36,28 @@ public class AccumulateTest
|
|
42
36
|
return new string(array);
|
43
37
|
}
|
44
38
|
|
45
|
-
[
|
46
|
-
[Test]
|
39
|
+
[Fact(Skip = "Remove to run test")]
|
47
40
|
public void Accumulate_within_accumulate()
|
48
41
|
{
|
49
42
|
var actual = new[] { "a", "b", "c" }.Accumulate(c =>
|
50
43
|
string.Join(" ", new[] { "1", "2", "3" }.Accumulate(d => c + d)));
|
51
|
-
Assert.
|
44
|
+
Assert.Equal(new[] { "a1 a2 a3", "b1 b2 b3", "c1 c2 c3" }, actual);
|
52
45
|
}
|
53
46
|
|
54
|
-
[
|
55
|
-
[Test]
|
47
|
+
[Fact(Skip = "Remove to run test")]
|
56
48
|
public void Accumulate_is_lazy()
|
57
49
|
{
|
58
50
|
var counter = 0;
|
59
51
|
var accumulation = new[] { 1, 2, 3 }.Accumulate(x => x * counter++);
|
60
52
|
|
61
|
-
Assert.
|
53
|
+
Assert.Equal(0, counter);
|
62
54
|
accumulation.ToList();
|
63
|
-
Assert.
|
55
|
+
Assert.Equal(3, counter);
|
64
56
|
}
|
65
57
|
|
66
|
-
[
|
67
|
-
[Test]
|
58
|
+
[Fact(Skip = "Remove to run test")]
|
68
59
|
public void Accumulate_allows_different_return_type()
|
69
60
|
{
|
70
|
-
Assert.
|
71
|
-
new[] { 1, 2, 3 }.Accumulate(x => x.ToString()),
|
72
|
-
Is.EqualTo(new[] { "1", "2", "3" }));
|
61
|
+
Assert.Equal(new[] { "1", "2", "3" }, new[] { 1, 2, 3 }.Accumulate(x => x.ToString()));
|
73
62
|
}
|
74
63
|
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
2
|
+
|
3
|
+
<PropertyGroup>
|
4
|
+
<OutputType>Exe</OutputType>
|
5
|
+
<TargetFramework>netcoreapp1.0</TargetFramework>
|
6
|
+
</PropertyGroup>
|
7
|
+
|
8
|
+
<ItemGroup>
|
9
|
+
<Compile Remove="Example.cs" />
|
10
|
+
</ItemGroup>
|
11
|
+
|
12
|
+
<ItemGroup>
|
13
|
+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
|
14
|
+
<PackageReference Include="xunit" Version="2.2.0" />
|
15
|
+
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
|
16
|
+
</ItemGroup>
|
17
|
+
|
18
|
+
</Project>
|