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
@@ -1,28 +1,26 @@
|
|
1
1
|
using System.Collections.Generic;
|
2
|
+
using System.Linq;
|
2
3
|
|
3
4
|
public class School
|
4
5
|
{
|
5
|
-
|
6
|
-
|
7
|
-
public School()
|
8
|
-
{
|
9
|
-
Roster = new Dictionary<int, IList<string>>();
|
10
|
-
}
|
11
|
-
|
6
|
+
private readonly Dictionary<int, IList<string>> roster = new Dictionary<int, IList<string>>();
|
7
|
+
|
12
8
|
public void Add(string student, int grade)
|
13
9
|
{
|
14
|
-
if (
|
15
|
-
|
10
|
+
if (roster.ContainsKey(grade))
|
11
|
+
roster[grade].Add(student);
|
16
12
|
else
|
17
|
-
|
13
|
+
roster.Add(grade, new SortedList<string> { student });
|
18
14
|
}
|
19
15
|
|
20
|
-
public
|
16
|
+
public IEnumerable<string> Roster(int grade) => roster[grade];
|
17
|
+
|
18
|
+
public IEnumerable<string> Grade(int grade)
|
21
19
|
{
|
22
20
|
IList<string> students;
|
23
|
-
if (
|
24
|
-
return students;
|
25
|
-
return
|
21
|
+
if (roster.TryGetValue(grade, out students))
|
22
|
+
return students.AsEnumerable();
|
23
|
+
return Enumerable.Empty<string>();
|
26
24
|
}
|
27
25
|
}
|
28
26
|
|
@@ -0,0 +1,20 @@
|
|
1
|
+
using System;
|
2
|
+
using System.Collections.Generic;
|
3
|
+
|
4
|
+
public class School
|
5
|
+
{
|
6
|
+
public void Add(string student, int grade)
|
7
|
+
{
|
8
|
+
throw new NotImplementedException("You need to implement this function.");
|
9
|
+
}
|
10
|
+
|
11
|
+
public IEnumerable<string> Roster(int grade)
|
12
|
+
{
|
13
|
+
throw new NotImplementedException("You need to implement this function.");
|
14
|
+
}
|
15
|
+
|
16
|
+
public IEnumerable<string> Grade(int grade)
|
17
|
+
{
|
18
|
+
throw new NotImplementedException("You need to implement this function.");
|
19
|
+
}
|
20
|
+
}
|
@@ -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,81 +1,61 @@
|
|
1
|
-
using
|
2
|
-
using NUnit.Framework;
|
1
|
+
using Xunit;
|
3
2
|
|
4
|
-
[TestFixture]
|
5
3
|
public class GradeSchoolTest
|
6
4
|
{
|
7
|
-
private School school;
|
8
|
-
|
9
|
-
[
|
10
|
-
public void Setup()
|
11
|
-
{
|
12
|
-
school = new School();
|
13
|
-
}
|
14
|
-
|
15
|
-
[Test]
|
16
|
-
public void New_school_has_an_empty_roster()
|
17
|
-
{
|
18
|
-
Assert.That(school.Roster, Has.Count.EqualTo(0));
|
19
|
-
}
|
20
|
-
|
21
|
-
[Ignore("Remove to run test")]
|
22
|
-
[Test]
|
5
|
+
private readonly School school = new School();
|
6
|
+
|
7
|
+
[Fact]
|
23
8
|
public void Adding_a_student_adds_them_to_the_roster_for_the_given_grade()
|
24
9
|
{
|
25
10
|
school.Add("Aimee", 2);
|
26
|
-
var expected = new
|
27
|
-
Assert.
|
11
|
+
var expected = new [] { "Aimee" };
|
12
|
+
Assert.Equal(expected, school.Roster(2));
|
28
13
|
}
|
29
14
|
|
30
|
-
[
|
31
|
-
[Test]
|
15
|
+
[Fact(Skip = "Remove to run test")]
|
32
16
|
public void Adding_more_students_to_the_same_grade_adds_them_to_the_roster()
|
33
17
|
{
|
34
18
|
school.Add("Blair", 2);
|
35
19
|
school.Add("James", 2);
|
36
20
|
school.Add("Paul", 2);
|
37
|
-
var expected = new
|
38
|
-
Assert.
|
21
|
+
var expected = new [] { "Blair", "James", "Paul" };
|
22
|
+
Assert.Equal(expected, school.Roster(2));
|
39
23
|
}
|
40
24
|
|
41
|
-
[
|
42
|
-
[Test]
|
25
|
+
[Fact(Skip = "Remove to run test")]
|
43
26
|
public void Adding_students_to_different_grades_adds_them_to_the_roster()
|
44
27
|
{
|
45
28
|
school.Add("Chelsea", 3);
|
46
29
|
school.Add("Logan", 7);
|
47
|
-
Assert.
|
48
|
-
Assert.
|
30
|
+
Assert.Equal(new [] { "Chelsea" }, school.Roster(3));
|
31
|
+
Assert.Equal(new [] { "Logan" }, school.Roster(7));
|
49
32
|
}
|
50
33
|
|
51
|
-
[
|
52
|
-
[Test]
|
34
|
+
[Fact(Skip = "Remove to run test")]
|
53
35
|
public void Grade_returns_the_students_in_that_grade_in_alphabetical_order()
|
54
36
|
{
|
55
37
|
school.Add("Franklin", 5);
|
56
38
|
school.Add("Bradley", 5);
|
57
39
|
school.Add("Jeff", 1);
|
58
|
-
var expected = new
|
59
|
-
Assert.
|
40
|
+
var expected = new [] { "Bradley", "Franklin" };
|
41
|
+
Assert.Equal(expected, school.Grade(5));
|
60
42
|
}
|
61
43
|
|
62
|
-
[
|
63
|
-
[Test]
|
44
|
+
[Fact(Skip = "Remove to run test")]
|
64
45
|
public void Grade_returns_an_empty_list_if_there_are_no_students_in_that_grade()
|
65
46
|
{
|
66
|
-
Assert.
|
47
|
+
Assert.Empty(school.Grade(1));
|
67
48
|
}
|
68
49
|
|
69
|
-
[
|
70
|
-
[Test]
|
50
|
+
[Fact(Skip = "Remove to run test")]
|
71
51
|
public void Student_names_in_each_grade_in_roster_are_sorted()
|
72
52
|
{
|
73
53
|
school.Add("Jennifer", 4);
|
74
54
|
school.Add("Kareem", 6);
|
75
55
|
school.Add("Christopher", 4);
|
76
56
|
school.Add("Kyle", 3);
|
77
|
-
Assert.
|
78
|
-
Assert.
|
79
|
-
Assert.
|
57
|
+
Assert.Equal(new [] { "Kyle" }, school.Roster(3));
|
58
|
+
Assert.Equal(new [] { "Christopher", "Jennifer" }, school.Roster(4));
|
59
|
+
Assert.Equal(new [] { "Kareem" }, school.Roster(6));
|
80
60
|
}
|
81
61
|
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
using System;
|
2
|
+
|
3
|
+
public static class Grains
|
4
|
+
{
|
5
|
+
public static ulong Square(int n)
|
6
|
+
{
|
7
|
+
throw new NotImplementedException("You need to implement this function.");
|
8
|
+
}
|
9
|
+
|
10
|
+
public static ulong Total()
|
11
|
+
{
|
12
|
+
throw new NotImplementedException("You need to implement this function.");
|
13
|
+
}
|
14
|
+
}
|
@@ -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,60 +1,52 @@
|
|
1
|
-
using
|
1
|
+
using Xunit;
|
2
2
|
|
3
|
-
[TestFixture]
|
4
3
|
public class GrainsTest
|
5
4
|
{
|
6
|
-
[
|
5
|
+
[Fact]
|
7
6
|
public void Test_square_1()
|
8
7
|
{
|
9
|
-
Assert.
|
8
|
+
Assert.Equal(1ul, Grains.Square(1));
|
10
9
|
}
|
11
10
|
|
12
|
-
[
|
13
|
-
[Test]
|
11
|
+
[Fact(Skip = "Remove to run test")]
|
14
12
|
public void Test_square_2()
|
15
13
|
{
|
16
|
-
Assert.
|
14
|
+
Assert.Equal(2ul, Grains.Square(2));
|
17
15
|
}
|
18
16
|
|
19
|
-
[
|
20
|
-
[Test]
|
17
|
+
[Fact(Skip = "Remove to run test")]
|
21
18
|
public void Test_square_3()
|
22
19
|
{
|
23
|
-
Assert.
|
20
|
+
Assert.Equal(4ul, Grains.Square(3));
|
24
21
|
}
|
25
22
|
|
26
|
-
[
|
27
|
-
[Test]
|
23
|
+
[Fact(Skip = "Remove to run test")]
|
28
24
|
public void Test_square_4()
|
29
25
|
{
|
30
|
-
Assert.
|
26
|
+
Assert.Equal(8ul, Grains.Square(4));
|
31
27
|
}
|
32
28
|
|
33
|
-
[
|
34
|
-
[Test]
|
29
|
+
[Fact(Skip = "Remove to run test")]
|
35
30
|
public void Test_square_16()
|
36
31
|
{
|
37
|
-
Assert.
|
32
|
+
Assert.Equal(32768ul, Grains.Square(16));
|
38
33
|
}
|
39
34
|
|
40
|
-
[
|
41
|
-
[Test]
|
35
|
+
[Fact(Skip = "Remove to run test")]
|
42
36
|
public void Test_square_32()
|
43
37
|
{
|
44
|
-
Assert.
|
38
|
+
Assert.Equal(2147483648ul, Grains.Square(32));
|
45
39
|
}
|
46
40
|
|
47
|
-
[
|
48
|
-
[Test]
|
41
|
+
[Fact(Skip = "Remove to run test")]
|
49
42
|
public void Test_square_64()
|
50
43
|
{
|
51
|
-
Assert.
|
44
|
+
Assert.Equal(9223372036854775808ul, Grains.Square(64));
|
52
45
|
}
|
53
46
|
|
54
|
-
[
|
55
|
-
[Test]
|
47
|
+
[Fact(Skip = "Remove to run test")]
|
56
48
|
public void Test_total_grains()
|
57
49
|
{
|
58
|
-
Assert.
|
50
|
+
Assert.Equal(18446744073709551615ul, Grains.Total());
|
59
51
|
}
|
60
52
|
}
|
@@ -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,7 +1,8 @@
|
|
1
|
-
using System
|
2
|
-
using
|
1
|
+
using System;
|
2
|
+
using System.IO;
|
3
|
+
using Xunit;
|
3
4
|
|
4
|
-
public class GrepTest
|
5
|
+
public class GrepTest : IDisposable
|
5
6
|
{
|
6
7
|
private const string IliadFileName = "iliad.txt";
|
7
8
|
private const string IliadContents =
|
@@ -38,18 +39,16 @@ Sing Heav'nly Muse, that on the secret top
|
|
38
39
|
Of Oreb, or of Sinai, didst inspire
|
39
40
|
That Shepherd, who first taught the chosen Seed
|
40
41
|
";
|
41
|
-
|
42
|
-
|
43
|
-
public void SetUp()
|
42
|
+
|
43
|
+
public GrepTest()
|
44
44
|
{
|
45
45
|
Directory.SetCurrentDirectory(Path.GetTempPath());
|
46
46
|
File.WriteAllText(IliadFileName, IliadContents);
|
47
47
|
File.WriteAllText(MidsummerNightFileName, MidsummerNightContents);
|
48
48
|
File.WriteAllText(ParadiseLostFileName, ParadiseLostContents);
|
49
49
|
}
|
50
|
-
|
51
|
-
|
52
|
-
public void TearDown()
|
50
|
+
|
51
|
+
public void Dispose()
|
53
52
|
{
|
54
53
|
Directory.SetCurrentDirectory(Path.GetTempPath());
|
55
54
|
File.Delete(IliadFileName);
|
@@ -57,7 +56,7 @@ That Shepherd, who first taught the chosen Seed
|
|
57
56
|
File.Delete(ParadiseLostFileName);
|
58
57
|
}
|
59
58
|
|
60
|
-
[
|
59
|
+
[Fact]
|
61
60
|
public void One_file_one_match_no_flags()
|
62
61
|
{
|
63
62
|
const string pattern = "Agamemnon";
|
@@ -67,11 +66,10 @@ That Shepherd, who first taught the chosen Seed
|
|
67
66
|
const string expected =
|
68
67
|
"Of Atreus, Agamemnon, King of men.\n";
|
69
68
|
|
70
|
-
Assert.
|
69
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
71
70
|
}
|
72
71
|
|
73
|
-
[
|
74
|
-
[Test]
|
72
|
+
[Fact(Skip = "Remove to run test")]
|
75
73
|
public void One_file_one_match_print_line_numbers_flag()
|
76
74
|
{
|
77
75
|
const string pattern = "Forbidden";
|
@@ -81,11 +79,10 @@ That Shepherd, who first taught the chosen Seed
|
|
81
79
|
const string expected =
|
82
80
|
"2:Of that Forbidden Tree, whose mortal tast\n";
|
83
81
|
|
84
|
-
Assert.
|
82
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
85
83
|
}
|
86
84
|
|
87
|
-
[
|
88
|
-
[Test]
|
85
|
+
[Fact(Skip = "Remove to run test")]
|
89
86
|
public void One_file_one_match_case_insensitive_flag()
|
90
87
|
{
|
91
88
|
const string pattern = "Forbidden";
|
@@ -95,11 +92,10 @@ That Shepherd, who first taught the chosen Seed
|
|
95
92
|
const string expected =
|
96
93
|
"Of that Forbidden Tree, whose mortal tast\n";
|
97
94
|
|
98
|
-
Assert.
|
95
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
99
96
|
}
|
100
97
|
|
101
|
-
[
|
102
|
-
[Test]
|
98
|
+
[Fact(Skip = "Remove to run test")]
|
103
99
|
public void One_file_one_match_print_file_names_flag()
|
104
100
|
{
|
105
101
|
const string pattern = "Forbidden";
|
@@ -109,11 +105,10 @@ That Shepherd, who first taught the chosen Seed
|
|
109
105
|
var expected =
|
110
106
|
$"{ParadiseLostFileName}\n";
|
111
107
|
|
112
|
-
Assert.
|
108
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
113
109
|
}
|
114
110
|
|
115
|
-
[
|
116
|
-
[Test]
|
111
|
+
[Fact(Skip = "Remove to run test")]
|
117
112
|
public void One_file_one_match_match_entire_lines_flag()
|
118
113
|
{
|
119
114
|
const string pattern = "With loss of Eden, till one greater Man";
|
@@ -123,11 +118,10 @@ That Shepherd, who first taught the chosen Seed
|
|
123
118
|
const string expected =
|
124
119
|
"With loss of Eden, till one greater Man\n";
|
125
120
|
|
126
|
-
Assert.
|
121
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
127
122
|
}
|
128
123
|
|
129
|
-
[
|
130
|
-
[Test]
|
124
|
+
[Fact(Skip = "Remove to run test")]
|
131
125
|
public void One_file_one_match_multiple_flags()
|
132
126
|
{
|
133
127
|
const string pattern = "OF ATREUS, Agamemnon, KIng of MEN.";
|
@@ -136,11 +130,10 @@ That Shepherd, who first taught the chosen Seed
|
|
136
130
|
const string expected =
|
137
131
|
"9:Of Atreus, Agamemnon, King of men.\n";
|
138
132
|
|
139
|
-
Assert.
|
133
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
140
134
|
}
|
141
135
|
|
142
|
-
[
|
143
|
-
[Test]
|
136
|
+
[Fact(Skip = "Remove to run test")]
|
144
137
|
public void One_file_several_matches_no_flags()
|
145
138
|
{
|
146
139
|
const string pattern = "may";
|
@@ -152,11 +145,10 @@ That Shepherd, who first taught the chosen Seed
|
|
152
145
|
"But I beseech your grace that I may know\n" +
|
153
146
|
"The worst that may befall me in this case,\n";
|
154
147
|
|
155
|
-
Assert.
|
148
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
156
149
|
}
|
157
150
|
|
158
|
-
[
|
159
|
-
[Test]
|
151
|
+
[Fact(Skip = "Remove to run test")]
|
160
152
|
public void One_file_several_matches_print_line_numbers_flag()
|
161
153
|
{
|
162
154
|
const string pattern = "may";
|
@@ -168,11 +160,10 @@ That Shepherd, who first taught the chosen Seed
|
|
168
160
|
"5:But I beseech your grace that I may know\n" +
|
169
161
|
"6:The worst that may befall me in this case,\n";
|
170
162
|
|
171
|
-
Assert.
|
163
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
172
164
|
}
|
173
165
|
|
174
|
-
[
|
175
|
-
[Test]
|
166
|
+
[Fact(Skip = "Remove to run test")]
|
176
167
|
public void One_file_several_matches_match_entire_lines_flag()
|
177
168
|
{
|
178
169
|
const string pattern = "may";
|
@@ -181,11 +172,10 @@ That Shepherd, who first taught the chosen Seed
|
|
181
172
|
|
182
173
|
const string expected = "";
|
183
174
|
|
184
|
-
Assert.
|
175
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
185
176
|
}
|
186
177
|
|
187
|
-
[
|
188
|
-
[Test]
|
178
|
+
[Fact(Skip = "Remove to run test")]
|
189
179
|
public void One_file_several_matches_case_insensitive_flag()
|
190
180
|
{
|
191
181
|
const string pattern = "ACHILLES";
|
@@ -196,11 +186,10 @@ That Shepherd, who first taught the chosen Seed
|
|
196
186
|
"Achilles sing, O Goddess! Peleus' son;\n" +
|
197
187
|
"The noble Chief Achilles from the son\n";
|
198
188
|
|
199
|
-
Assert.
|
189
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
200
190
|
}
|
201
191
|
|
202
|
-
[
|
203
|
-
[Test]
|
192
|
+
[Fact(Skip = "Remove to run test")]
|
204
193
|
public void One_file_several_matches_inverted_flag()
|
205
194
|
{
|
206
195
|
const string pattern = "Of";
|
@@ -214,26 +203,26 @@ That Shepherd, who first taught the chosen Seed
|
|
214
203
|
"Sing Heav'nly Muse, that on the secret top\n" +
|
215
204
|
"That Shepherd, who first taught the chosen Seed\n";
|
216
205
|
|
217
|
-
Assert.
|
206
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
218
207
|
}
|
219
208
|
|
220
|
-
[
|
221
|
-
[
|
222
|
-
[
|
223
|
-
[
|
224
|
-
[
|
225
|
-
[
|
209
|
+
[Theory(Skip = "Remove to run test")]
|
210
|
+
[InlineData("")]
|
211
|
+
[InlineData("-n")]
|
212
|
+
[InlineData("-l")]
|
213
|
+
[InlineData("-x")]
|
214
|
+
[InlineData("-i")]
|
215
|
+
[InlineData("-n -l -x -i")]
|
226
216
|
public void One_file_no_matches_various_flags(string flags)
|
227
217
|
{
|
228
218
|
const string pattern = "Gandalf";
|
229
219
|
var files = new[] { IliadFileName };
|
230
220
|
const string expected = "";
|
231
221
|
|
232
|
-
Assert.
|
222
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
233
223
|
}
|
234
224
|
|
235
|
-
[
|
236
|
-
[Test]
|
225
|
+
[Fact(Skip = "Remove to run test")]
|
237
226
|
public void Multiple_files_one_match_no_flags()
|
238
227
|
{
|
239
228
|
const string pattern = "Agamemnon";
|
@@ -243,11 +232,10 @@ That Shepherd, who first taught the chosen Seed
|
|
243
232
|
var expected =
|
244
233
|
$"{IliadFileName}:Of Atreus, Agamemnon, King of men.\n";
|
245
234
|
|
246
|
-
Assert.
|
235
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
247
236
|
}
|
248
237
|
|
249
|
-
[
|
250
|
-
[Test]
|
238
|
+
[Fact(Skip = "Remove to run test")]
|
251
239
|
public void Multiple_files_several_matches_no_flags()
|
252
240
|
{
|
253
241
|
const string pattern = "may";
|
@@ -259,11 +247,10 @@ That Shepherd, who first taught the chosen Seed
|
|
259
247
|
$"{MidsummerNightFileName}:But I beseech your grace that I may know\n" +
|
260
248
|
$"{MidsummerNightFileName}:The worst that may befall me in this case,\n";
|
261
249
|
|
262
|
-
Assert.
|
250
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
263
251
|
}
|
264
252
|
|
265
|
-
[
|
266
|
-
[Test]
|
253
|
+
[Fact(Skip = "Remove to run test")]
|
267
254
|
public void Multiple_files_several_matches_print_line_numbers_flag()
|
268
255
|
{
|
269
256
|
const string pattern = "that";
|
@@ -276,11 +263,10 @@ That Shepherd, who first taught the chosen Seed
|
|
276
263
|
$"{ParadiseLostFileName}:2:Of that Forbidden Tree, whose mortal tast\n" +
|
277
264
|
$"{ParadiseLostFileName}:6:Sing Heav'nly Muse, that on the secret top\n";
|
278
265
|
|
279
|
-
Assert.
|
266
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
280
267
|
}
|
281
268
|
|
282
|
-
[
|
283
|
-
[Test]
|
269
|
+
[Fact(Skip = "Remove to run test")]
|
284
270
|
public void Multiple_files_several_matches_print_file_names_flag()
|
285
271
|
{
|
286
272
|
const string pattern = "who";
|
@@ -291,11 +277,10 @@ That Shepherd, who first taught the chosen Seed
|
|
291
277
|
$"{IliadFileName}\n" +
|
292
278
|
$"{ParadiseLostFileName}\n";
|
293
279
|
|
294
|
-
Assert.
|
280
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
295
281
|
}
|
296
282
|
|
297
|
-
[
|
298
|
-
[Test]
|
283
|
+
[Fact(Skip = "Remove to run test")]
|
299
284
|
public void Multiple_files_several_matches_case_insensitive_flag()
|
300
285
|
{
|
301
286
|
const string pattern = "TO";
|
@@ -314,11 +299,10 @@ That Shepherd, who first taught the chosen Seed
|
|
314
299
|
$"{ParadiseLostFileName}:Restore us, and regain the blissful Seat,\n" +
|
315
300
|
$"{ParadiseLostFileName}:Sing Heav'nly Muse, that on the secret top\n";
|
316
301
|
|
317
|
-
Assert.
|
302
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
318
303
|
}
|
319
304
|
|
320
|
-
[
|
321
|
-
[Test]
|
305
|
+
[Fact(Skip = "Remove to run test")]
|
322
306
|
public void Multiple_files_several_matches_inverted_flag()
|
323
307
|
{
|
324
308
|
const string pattern = "a";
|
@@ -330,11 +314,10 @@ That Shepherd, who first taught the chosen Seed
|
|
330
314
|
$"{IliadFileName}:The noble Chief Achilles from the son\n" +
|
331
315
|
$"{MidsummerNightFileName}:If I refuse to wed Demetrius.\n";
|
332
316
|
|
333
|
-
Assert.
|
317
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
334
318
|
}
|
335
319
|
|
336
|
-
[
|
337
|
-
[Test]
|
320
|
+
[Fact(Skip = "Remove to run test")]
|
338
321
|
public void Multiple_files_one_match_match_entire_lines_flag()
|
339
322
|
{
|
340
323
|
const string pattern = "But I beseech your grace that I may know";
|
@@ -344,11 +327,10 @@ That Shepherd, who first taught the chosen Seed
|
|
344
327
|
var expected =
|
345
328
|
$"{MidsummerNightFileName}:But I beseech your grace that I may know\n";
|
346
329
|
|
347
|
-
Assert.
|
330
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
348
331
|
}
|
349
332
|
|
350
|
-
[
|
351
|
-
[Test]
|
333
|
+
[Fact(Skip = "Remove to run test")]
|
352
334
|
public void Multiple_files_one_match_multiple_flags()
|
353
335
|
{
|
354
336
|
const string pattern = "WITH LOSS OF EDEN, TILL ONE GREATER MAN";
|
@@ -357,15 +339,16 @@ That Shepherd, who first taught the chosen Seed
|
|
357
339
|
var expected =
|
358
340
|
$"{ParadiseLostFileName}:4:With loss of Eden, till one greater Man\n";
|
359
341
|
|
360
|
-
Assert.
|
342
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
361
343
|
}
|
362
344
|
|
363
|
-
[
|
364
|
-
[
|
365
|
-
[
|
366
|
-
[
|
367
|
-
[
|
368
|
-
[
|
345
|
+
[Theory(Skip = "Remove to run test")]
|
346
|
+
[InlineData("")]
|
347
|
+
[InlineData("-n")]
|
348
|
+
[InlineData("-l")]
|
349
|
+
[InlineData("-x")]
|
350
|
+
[InlineData("-i")]
|
351
|
+
[InlineData("-n -l -x -i")]
|
369
352
|
public void Multiple_files_no_matches_various_flags(string flags)
|
370
353
|
{
|
371
354
|
const string pattern = "Frodo";
|
@@ -373,6 +356,6 @@ That Shepherd, who first taught the chosen Seed
|
|
373
356
|
|
374
357
|
const string expected = "";
|
375
358
|
|
376
|
-
Assert.
|
359
|
+
Assert.Equal(expected, Grep.Find(pattern, flags, files));
|
377
360
|
}
|
378
361
|
}
|