trackler 2.2.1.151 → 2.2.1.152
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/hamming/description.md +4 -3
- data/problem-specifications/exercises/isbn-verifier/canonical-data.json +9 -1
- data/tracks/clojure/exercises/bob/README.md +2 -0
- data/tracks/clojure/exercises/bob/src/example.clj +4 -0
- data/tracks/clojure/exercises/bob/test/bob_test.clj +1 -1
- data/tracks/clojure/exercises/say/README.md +2 -1
- data/tracks/csharp/exercises/acronym/AcronymTest.cs +3 -9
- data/tracks/csharp/exercises/all-your-base/AllYourBaseTest.cs +43 -43
- data/tracks/csharp/exercises/allergies/AllergiesTest.cs +1 -1
- data/tracks/csharp/exercises/alphametics/AlphameticsTest.cs +21 -1
- data/tracks/csharp/exercises/anagram/AnagramTest.cs +1 -35
- data/tracks/csharp/exercises/atbash-cipher/AtbashCipherTest.cs +1 -1
- data/tracks/csharp/exercises/beer-song/BeerSong.cs +1 -6
- data/tracks/csharp/exercises/beer-song/BeerSongTest.cs +20 -28
- data/tracks/csharp/exercises/beer-song/Example.cs +6 -6
- data/tracks/csharp/exercises/binary-search/BinarySearchTest.cs +1 -1
- data/tracks/csharp/exercises/bob/BobTest.cs +1 -1
- data/tracks/csharp/exercises/book-store/BookStoreTest.cs +1 -1
- data/tracks/csharp/exercises/bowling/BowlingTest.cs +47 -29
- data/tracks/csharp/exercises/bracket-push/BracketPushTest.cs +36 -29
- data/tracks/csharp/exercises/change/Change.cs +1 -1
- data/tracks/csharp/exercises/change/ChangeTest.cs +48 -21
- data/tracks/csharp/exercises/change/Example.cs +31 -18
- data/tracks/csharp/exercises/circular-buffer/CircularBuffer.cs +2 -2
- data/tracks/csharp/exercises/circular-buffer/CircularBufferTest.cs +88 -111
- data/tracks/csharp/exercises/circular-buffer/Example.cs +7 -7
- data/tracks/csharp/exercises/clock/ClockTest.cs +37 -37
- data/tracks/csharp/exercises/collatz-conjecture/CollatzConjectureTest.cs +1 -1
- data/tracks/csharp/exercises/complex-numbers/ComplexNumbersTest.cs +19 -10
- data/tracks/csharp/exercises/connect/ConnectTest.cs +1 -1
- data/tracks/csharp/exercises/crypto-square/CryptoSquareTest.cs +1 -1
- data/tracks/csharp/exercises/custom-set/.meta/hints.md +3 -3
- data/tracks/csharp/exercises/custom-set/CustomSet.cs +10 -49
- data/tracks/csharp/exercises/custom-set/CustomSetTest.cs +153 -157
- data/tracks/csharp/exercises/custom-set/Example.cs +26 -54
- data/tracks/csharp/exercises/difference-of-squares/DifferenceOfSquaresTest.cs +1 -1
- data/tracks/csharp/exercises/dominoes/DominoesTest.cs +25 -25
- data/tracks/csharp/exercises/etl/Etl.cs +1 -1
- data/tracks/csharp/exercises/etl/EtlTest.cs +4 -4
- data/tracks/csharp/exercises/etl/Example.cs +1 -1
- data/tracks/csharp/exercises/flatten-array/FlattenArrayTest.cs +13 -13
- data/tracks/csharp/exercises/food-chain/Example.cs +5 -0
- data/tracks/csharp/exercises/food-chain/FoodChain.cs +5 -0
- data/tracks/csharp/exercises/food-chain/FoodChainTest.cs +9 -9
- data/tracks/csharp/exercises/forth/Example.cs +28 -33
- data/tracks/csharp/exercises/forth/Forth.cs +1 -19
- data/tracks/csharp/exercises/forth/ForthTest.cs +215 -52
- data/tracks/csharp/exercises/gigasecond/GigasecondTest.cs +1 -1
- data/tracks/csharp/exercises/grains/GrainsTest.cs +1 -1
- data/tracks/csharp/exercises/grep/Example.cs +1 -1
- data/tracks/csharp/exercises/grep/Grep.cs +1 -1
- data/tracks/csharp/exercises/grep/GrepTest.cs +268 -237
- data/tracks/csharp/exercises/hamming/HammingTest.cs +1 -1
- data/tracks/csharp/exercises/hello-world/HelloWorldTest.cs +1 -1
- data/tracks/csharp/exercises/house/Example.cs +7 -2
- data/tracks/csharp/exercises/house/House.cs +5 -0
- data/tracks/csharp/exercises/house/HouseTest.cs +40 -223
- data/tracks/csharp/exercises/isbn-verifier/IsbnVerifierTest.cs +14 -2
- data/tracks/csharp/exercises/isogram/IsogramTest.cs +1 -1
- data/tracks/csharp/exercises/kindergarten-garden/KindergartenGardenTest.cs +1 -1
- data/tracks/csharp/exercises/largest-series-product/LargestSeriesProductTest.cs +1 -1
- data/tracks/csharp/exercises/leap/LeapTest.cs +1 -1
- data/tracks/csharp/exercises/luhn/LuhnTest.cs +1 -1
- data/tracks/csharp/exercises/markdown/MarkdownTest.cs +34 -27
- data/tracks/csharp/exercises/minesweeper/MinesweeperTest.cs +29 -34
- data/tracks/csharp/exercises/nth-prime/NthPrimeTest.cs +1 -1
- data/tracks/csharp/exercises/nucleotide-count/NucleotideCountTest.cs +1 -1
- data/tracks/csharp/exercises/ocr-numbers/OcrNumbersTest.cs +35 -35
- data/tracks/csharp/exercises/pangram/PangramTest.cs +1 -1
- data/tracks/csharp/exercises/pascals-triangle/PascalsTriangleTest.cs +1 -1
- data/tracks/csharp/exercises/perfect-numbers/PerfectNumbersTest.cs +1 -1
- data/tracks/csharp/exercises/phone-number/PhoneNumberTest.cs +17 -3
- data/tracks/csharp/exercises/pig-latin/PigLatinTest.cs +1 -1
- data/tracks/csharp/exercises/poker/PokerTest.cs +1 -1
- data/tracks/csharp/exercises/prime-factors/PrimeFactorsTest.cs +1 -1
- data/tracks/csharp/exercises/protein-translation/Example.cs +4 -4
- data/tracks/csharp/exercises/protein-translation/ProteinTranslation.cs +1 -1
- data/tracks/csharp/exercises/protein-translation/ProteinTranslationTest.cs +104 -45
- data/tracks/csharp/exercises/proverb/ProverbTest.cs +38 -6
- data/tracks/csharp/exercises/queen-attack/QueenAttackTest.cs +1 -1
- data/tracks/csharp/exercises/rail-fence-cipher/RailFenceCipherTest.cs +1 -1
- data/tracks/csharp/exercises/raindrops/RaindropsTest.cs +1 -1
- data/tracks/csharp/exercises/rectangles/RectanglesTest.cs +63 -21
- data/tracks/csharp/exercises/reverse-string/ReverseStringTest.cs +1 -1
- data/tracks/csharp/exercises/rna-transcription/RnaTranscriptionTest.cs +1 -1
- data/tracks/csharp/exercises/roman-numerals/RomanNumeralsTest.cs +7 -1
- data/tracks/csharp/exercises/rotational-cipher/RotationalCipherTest.cs +1 -1
- data/tracks/csharp/exercises/run-length-encoding/RunLengthEncodingTest.cs +1 -1
- data/tracks/csharp/exercises/saddle-points/SaddlePointsTest.cs +11 -11
- data/tracks/csharp/exercises/say/SayTest.cs +1 -1
- data/tracks/csharp/exercises/scale-generator/Example.cs +5 -0
- data/tracks/csharp/exercises/scale-generator/ScaleGenerator.cs +5 -0
- data/tracks/csharp/exercises/scale-generator/ScaleGeneratorTest.cs +56 -47
- data/tracks/csharp/exercises/scrabble-score/ScrabbleScoreTest.cs +1 -1
- data/tracks/csharp/exercises/secret-handshake/SecretHandshakeTest.cs +1 -1
- data/tracks/csharp/exercises/sieve/SieveTest.cs +1 -1
- data/tracks/csharp/exercises/space-age/SpaceAgeTest.cs +1 -1
- data/tracks/csharp/exercises/spiral-matrix/SpiralMatrixTest.cs +28 -34
- data/tracks/csharp/exercises/sum-of-multiples/SumOfMultiplesTest.cs +1 -1
- data/tracks/csharp/exercises/tournament/Example.cs +15 -7
- data/tracks/csharp/exercises/tournament/TournamentTest.cs +97 -99
- data/tracks/csharp/exercises/transpose/TransposeTest.cs +50 -96
- data/tracks/csharp/exercises/triangle/TriangleTest.cs +1 -1
- data/tracks/csharp/exercises/twelve-days/TwelveDays.cs +1 -1
- data/tracks/csharp/exercises/two-bucket/TwoBucketTest.cs +1 -1
- data/tracks/csharp/exercises/two-fer/TwoFerTest.cs +1 -1
- data/tracks/csharp/exercises/variable-length-quantity/Example.cs +3 -3
- data/tracks/csharp/exercises/variable-length-quantity/VariableLengthQuantity.cs +2 -2
- data/tracks/csharp/exercises/variable-length-quantity/VariableLengthQuantityTest.cs +165 -40
- data/tracks/csharp/exercises/word-count/Example.cs +1 -1
- data/tracks/csharp/exercises/word-count/WordCount.cs +1 -1
- data/tracks/csharp/exercises/word-count/WordCountTest.cs +12 -12
- data/tracks/csharp/exercises/wordy/WordyTest.cs +1 -1
- data/tracks/csharp/exercises/yacht/Example.cs +2 -5
- data/tracks/csharp/exercises/yacht/YachtTest.cs +7 -1
- data/tracks/csharp/exercises/zebra-puzzle/Example.cs +4 -4
- data/tracks/csharp/exercises/zebra-puzzle/ZebraPuzzle.cs +2 -2
- data/tracks/csharp/exercises/zebra-puzzle/ZebraPuzzleTest.cs +7 -5
- data/tracks/csharp/generators/Exercises/AllYourBase.cs +1 -0
- data/tracks/csharp/generators/Exercises/Alphametics.cs +5 -2
- data/tracks/csharp/generators/Exercises/BeerSong.cs +3 -0
- data/tracks/csharp/generators/Exercises/BinarySearch.cs +1 -0
- data/tracks/csharp/generators/Exercises/BookStore.cs +2 -0
- data/tracks/csharp/generators/Exercises/Bowling.cs +20 -15
- data/tracks/csharp/generators/Exercises/BracketPush.cs +1 -1
- data/tracks/csharp/generators/Exercises/Change.cs +20 -0
- data/tracks/csharp/generators/Exercises/CircularBuffer.cs +74 -0
- data/tracks/csharp/generators/Exercises/Clock.cs +7 -8
- data/tracks/csharp/generators/Exercises/ComplexNumbers.cs +9 -16
- data/tracks/csharp/generators/Exercises/Connect.cs +6 -6
- data/tracks/csharp/generators/Exercises/CustomSet.cs +56 -0
- data/tracks/csharp/generators/Exercises/Dominoes.cs +2 -2
- data/tracks/csharp/generators/Exercises/Etl.cs +7 -35
- data/tracks/csharp/generators/Exercises/FlattenArray.cs +9 -13
- data/tracks/csharp/generators/Exercises/FoodChain.cs +5 -0
- data/tracks/csharp/generators/Exercises/Forth.cs +25 -0
- data/tracks/csharp/generators/Exercises/Gigasecond.cs +4 -4
- data/tracks/csharp/generators/Exercises/Grains.cs +1 -1
- data/tracks/csharp/generators/Exercises/Grep.cs +106 -0
- data/tracks/csharp/generators/Exercises/Hamming.cs +1 -1
- data/tracks/csharp/generators/Exercises/House.cs +5 -0
- data/tracks/csharp/generators/Exercises/KindergartenGarden.cs +3 -3
- data/tracks/csharp/generators/Exercises/Markdown.cs +25 -0
- data/tracks/csharp/generators/Exercises/Meetup.cs +6 -6
- data/tracks/csharp/generators/Exercises/Minesweeper.cs +14 -4
- data/tracks/csharp/generators/Exercises/OcrNumbers.cs +12 -3
- data/tracks/csharp/generators/Exercises/PascalsTriangle.cs +0 -7
- data/tracks/csharp/generators/Exercises/ProteinTranslation.cs +8 -0
- data/tracks/csharp/generators/Exercises/Proverb.cs +7 -5
- data/tracks/csharp/generators/Exercises/QueenAttack.cs +3 -3
- data/tracks/csharp/generators/Exercises/Rectangles.cs +17 -0
- data/tracks/csharp/generators/Exercises/RobotSimulator.cs +6 -6
- data/tracks/csharp/generators/Exercises/SaddlePoints.cs +2 -2
- data/tracks/csharp/generators/Exercises/Say.cs +1 -1
- data/tracks/csharp/generators/Exercises/ScaleGenerator.cs +15 -0
- data/tracks/csharp/generators/Exercises/SpiralMatrix.cs +45 -0
- data/tracks/csharp/generators/Exercises/Sublist.cs +4 -5
- data/tracks/csharp/generators/Exercises/SumOfMultiples.cs +10 -1
- data/tracks/csharp/generators/Exercises/Tournament.cs +11 -19
- data/tracks/csharp/generators/Exercises/Transpose.cs +2 -2
- data/tracks/csharp/generators/Exercises/Triangle.cs +1 -3
- data/tracks/csharp/generators/Exercises/TwelveDays.cs +3 -4
- data/tracks/csharp/generators/Exercises/TwoBucket.cs +5 -5
- data/tracks/csharp/generators/Exercises/TwoFer.cs +11 -2
- data/tracks/csharp/generators/Exercises/VariableLengthQuantity.cs +44 -0
- data/tracks/csharp/generators/Exercises/Yacht.cs +11 -10
- data/tracks/csharp/generators/Exercises/ZebraPuzzle.cs +19 -0
- data/tracks/csharp/generators/GeneratorExercise.cs +6 -6
- data/tracks/csharp/generators/Input/CanonicalData.cs +6 -9
- data/tracks/csharp/generators/Input/CanonicalDataCase.cs +13 -46
- data/tracks/csharp/generators/Input/CanonicalDataCaseParser.cs +170 -0
- data/tracks/csharp/generators/Input/CanonicalDataFile.cs +1 -2
- data/tracks/csharp/generators/Input/CanonicalDataParser.cs +16 -12
- data/tracks/csharp/generators/Input/ConfigFile.cs +0 -5
- data/tracks/csharp/generators/Input/ConvertHelper.cs +20 -0
- data/tracks/csharp/generators/Output/Templates/_TestClassDisposable.liquid +14 -0
- data/tracks/csharp/generators/Output/TestMethodBodyData.cs +11 -14
- data/tracks/csharp/generators/Output/ValueFormatter.cs +20 -7
- data/tracks/delphi/config.json +22 -0
- data/tracks/delphi/exercises/grade-school/GradeSchool.dpr +60 -0
- data/tracks/delphi/exercises/grade-school/README.md +62 -0
- data/tracks/delphi/exercises/grade-school/uGradeSchoolExample.pas +134 -0
- data/tracks/delphi/exercises/grade-school/uGradeSchoolTest.pas +150 -0
- data/tracks/delphi/exercises/hamming/README.md +4 -3
- data/tracks/delphi/exercises/proverb/Proverb.dpr +60 -0
- data/tracks/delphi/exercises/proverb/README.md +44 -0
- data/tracks/delphi/exercises/proverb/uProverbExample.pas +60 -0
- data/tracks/delphi/exercises/proverb/uProverbTests.pas +124 -0
- data/tracks/go/exercises/bracket-push/README.md +3 -2
- data/tracks/go/exercises/bracket-push/cases_test.go +7 -2
- data/tracks/go/exercises/isbn-verifier/cases_test.go +4 -3
- data/tracks/go/exercises/yacht/cases_test.go +8 -2
- data/tracks/java/exercises/armstrong-numbers/README.md +1 -1
- data/tracks/java/exercises/binary-search-tree/src/test/java/BinarySearchTreeTest.java +22 -22
- data/tracks/java/exercises/bracket-push/README.md +3 -2
- data/tracks/java/exercises/crypto-square/README.md +23 -19
- data/tracks/java/exercises/grade-school/src/test/java/SchoolTest.java +1 -1
- data/tracks/java/exercises/poker/.meta/{version.txt → version} +0 -0
- data/tracks/java/exercises/queen-attack/src/test/java/QueenAttackCalculatorTest.java +7 -7
- data/tracks/java/exercises/rail-fence-cipher/.meta/version +1 -0
- data/tracks/java/exercises/robot-simulator/src/test/java/RobotTest.java +45 -45
- data/tracks/nim/config.json +24 -0
- data/tracks/nim/exercises/armstrong-numbers/README.md +18 -0
- data/tracks/nim/exercises/armstrong-numbers/armstrong_number_test.nim +29 -0
- data/tracks/nim/exercises/armstrong-numbers/example.nim +11 -0
- data/tracks/nim/exercises/leap/leap_test.nim +12 -10
- data/tracks/nim/exercises/two-fer/README.md +19 -0
- data/tracks/nim/exercises/two-fer/example.nim +3 -0
- data/tracks/nim/exercises/two-fer/two_fer_test.nim +16 -0
- data/tracks/python/.travis.yml +0 -1
- data/tracks/python/README.md +1 -1
- data/tracks/python/config/exercise_readme.go.tmpl +1 -1
- data/tracks/python/docs/INSTALLATION.md +1 -1
- data/tracks/python/exercises/accumulate/README.md +1 -1
- data/tracks/python/exercises/acronym/README.md +1 -1
- data/tracks/python/exercises/all-your-base/README.md +1 -1
- data/tracks/python/exercises/allergies/README.md +1 -1
- data/tracks/python/exercises/alphametics/README.md +1 -1
- data/tracks/python/exercises/anagram/README.md +1 -1
- data/tracks/python/exercises/armstrong-numbers/README.md +2 -2
- data/tracks/python/exercises/atbash-cipher/README.md +1 -1
- data/tracks/python/exercises/bank-account/README.md +1 -1
- data/tracks/python/exercises/beer-song/README.md +1 -1
- data/tracks/python/exercises/binary-search-tree/README.md +1 -1
- data/tracks/python/exercises/binary-search/README.md +1 -1
- data/tracks/python/exercises/binary/README.md +1 -1
- data/tracks/python/exercises/bob/README.md +1 -1
- data/tracks/python/exercises/book-store/README.md +1 -1
- data/tracks/python/exercises/bowling/README.md +1 -1
- data/tracks/python/exercises/bracket-push/README.md +4 -3
- data/tracks/python/exercises/change/README.md +1 -1
- data/tracks/python/exercises/circular-buffer/README.md +1 -1
- data/tracks/python/exercises/clock/README.md +1 -1
- data/tracks/python/exercises/collatz-conjecture/README.md +1 -1
- data/tracks/python/exercises/complex-numbers/README.md +1 -1
- data/tracks/python/exercises/connect/README.md +1 -1
- data/tracks/python/exercises/crypto-square/README.md +1 -1
- data/tracks/python/exercises/custom-set/README.md +1 -1
- data/tracks/python/exercises/diamond/README.md +1 -1
- data/tracks/python/exercises/difference-of-squares/README.md +1 -1
- data/tracks/python/exercises/diffie-hellman/README.md +1 -1
- data/tracks/python/exercises/dominoes/README.md +1 -1
- data/tracks/python/exercises/dot-dsl/README.md +1 -1
- data/tracks/python/exercises/error-handling/README.md +1 -1
- data/tracks/python/exercises/etl/README.md +1 -1
- data/tracks/python/exercises/flatten-array/README.md +1 -1
- data/tracks/python/exercises/food-chain/README.md +1 -1
- data/tracks/python/exercises/forth/README.md +1 -1
- data/tracks/python/exercises/gigasecond/README.md +1 -1
- data/tracks/python/exercises/go-counting/README.md +1 -1
- data/tracks/python/exercises/grade-school/README.md +1 -1
- data/tracks/python/exercises/grains/README.md +1 -1
- data/tracks/python/exercises/grep/README.md +1 -1
- data/tracks/python/exercises/hamming/README.md +1 -1
- data/tracks/python/exercises/hello-world/README.md +1 -1
- data/tracks/python/exercises/hexadecimal/README.md +1 -1
- data/tracks/python/exercises/house/README.md +1 -1
- data/tracks/python/exercises/isbn-verifier/README.md +1 -1
- data/tracks/python/exercises/isogram/README.md +1 -1
- data/tracks/python/exercises/kindergarten-garden/README.md +1 -1
- data/tracks/python/exercises/largest-series-product/README.md +1 -1
- data/tracks/python/exercises/leap/README.md +1 -1
- data/tracks/python/exercises/linked-list/README.md +1 -1
- data/tracks/python/exercises/list-ops/README.md +1 -1
- data/tracks/python/exercises/luhn/README.md +1 -1
- data/tracks/python/exercises/markdown/README.md +1 -1
- data/tracks/python/exercises/matrix/README.md +1 -1
- data/tracks/python/exercises/meetup/README.md +1 -1
- data/tracks/python/exercises/minesweeper/README.md +1 -1
- data/tracks/python/exercises/nth-prime/README.md +1 -1
- data/tracks/python/exercises/nucleotide-count/README.md +1 -1
- data/tracks/python/exercises/ocr-numbers/README.md +1 -1
- data/tracks/python/exercises/octal/README.md +1 -1
- data/tracks/python/exercises/palindrome-products/README.md +1 -1
- data/tracks/python/exercises/pangram/README.md +1 -1
- data/tracks/python/exercises/parallel-letter-frequency/README.md +1 -1
- data/tracks/python/exercises/pascals-triangle/README.md +1 -1
- data/tracks/python/exercises/perfect-numbers/README.md +1 -1
- data/tracks/python/exercises/phone-number/README.md +1 -1
- data/tracks/python/exercises/pig-latin/README.md +1 -1
- data/tracks/python/exercises/point-mutations/README.md +1 -1
- data/tracks/python/exercises/poker/README.md +1 -1
- data/tracks/python/exercises/pov/README.md +1 -1
- data/tracks/python/exercises/prime-factors/README.md +1 -1
- data/tracks/python/exercises/protein-translation/README.md +1 -1
- data/tracks/python/exercises/proverb/README.md +1 -1
- data/tracks/python/exercises/pythagorean-triplet/README.md +1 -1
- data/tracks/python/exercises/queen-attack/README.md +1 -1
- data/tracks/python/exercises/rail-fence-cipher/README.md +1 -1
- data/tracks/python/exercises/raindrops/README.md +1 -1
- data/tracks/python/exercises/rational-numbers/README.md +1 -1
- data/tracks/python/exercises/react/README.md +1 -1
- data/tracks/python/exercises/rectangles/README.md +1 -1
- data/tracks/python/exercises/reverse-string/README.md +1 -1
- data/tracks/python/exercises/rna-transcription/README.md +1 -1
- data/tracks/python/exercises/robot-name/README.md +1 -1
- data/tracks/python/exercises/robot-simulator/README.md +1 -1
- data/tracks/python/exercises/roman-numerals/README.md +1 -1
- data/tracks/python/exercises/rotational-cipher/README.md +1 -1
- data/tracks/python/exercises/run-length-encoding/README.md +1 -1
- data/tracks/python/exercises/saddle-points/README.md +1 -1
- data/tracks/python/exercises/say/README.md +1 -1
- data/tracks/python/exercises/scale-generator/README.md +1 -1
- data/tracks/python/exercises/scrabble-score/README.md +1 -1
- data/tracks/python/exercises/secret-handshake/README.md +1 -1
- data/tracks/python/exercises/series/README.md +1 -1
- data/tracks/python/exercises/sgf-parsing/README.md +1 -1
- data/tracks/python/exercises/sieve/README.md +1 -1
- data/tracks/python/exercises/simple-cipher/README.md +1 -1
- data/tracks/python/exercises/simple-linked-list/README.md +1 -1
- data/tracks/python/exercises/space-age/README.md +1 -1
- data/tracks/python/exercises/spiral-matrix/README.md +1 -1
- data/tracks/python/exercises/strain/README.md +1 -1
- data/tracks/python/exercises/sublist/README.md +1 -1
- data/tracks/python/exercises/sum-of-multiples/README.md +1 -1
- data/tracks/python/exercises/tournament/README.md +1 -1
- data/tracks/python/exercises/transpose/README.md +1 -1
- data/tracks/python/exercises/tree-building/README.md +1 -1
- data/tracks/python/exercises/triangle/README.md +1 -1
- data/tracks/python/exercises/trinary/README.md +1 -1
- data/tracks/python/exercises/twelve-days/README.md +1 -1
- data/tracks/python/exercises/two-bucket/README.md +1 -1
- data/tracks/python/exercises/two-fer/README.md +1 -1
- data/tracks/python/exercises/variable-length-quantity/README.md +1 -1
- data/tracks/python/exercises/word-count/README.md +1 -1
- data/tracks/python/exercises/word-search/README.md +1 -1
- data/tracks/python/exercises/wordy/README.md +1 -1
- data/tracks/python/exercises/yacht/README.md +1 -1
- data/tracks/python/exercises/zebra-puzzle/README.md +1 -1
- data/tracks/python/exercises/zipper/README.md +1 -1
- data/tracks/python/requirements-travis.txt +1 -1
- data/tracks/swift/exercises/scale-generator/Tests/ScaleGeneratorTests/ScaleGeneratorTests.swift +1 -1
- metadata +32 -8
- data/tracks/csharp/generators/Input/CanonicalDataCaseJson.cs +0 -73
- data/tracks/csharp/generators/Input/CanonicalDataCaseJsonConverter.cs +0 -49
- data/tracks/csharp/generators/Input/CanonicalDataCasesJson.cs +0 -58
- data/tracks/csharp/generators/Input/CanonicalDataCasesJsonConverter.cs +0 -17
- data/tracks/java/exercises/go-counting/src/main/java/.keep +0 -0
@@ -4,13 +4,13 @@
|
|
4
4
|
|
5
5
|
public class CircularBuffer<T>
|
6
6
|
{
|
7
|
-
private readonly int
|
7
|
+
private readonly int capacity;
|
8
8
|
private List<T> items;
|
9
9
|
|
10
|
-
public CircularBuffer(int
|
10
|
+
public CircularBuffer(int capacity)
|
11
11
|
{
|
12
|
-
this.
|
13
|
-
items = new List<T>(
|
12
|
+
this.capacity = capacity;
|
13
|
+
items = new List<T>(capacity);
|
14
14
|
}
|
15
15
|
|
16
16
|
public T Read()
|
@@ -29,7 +29,7 @@ public T Read()
|
|
29
29
|
|
30
30
|
public void Write(T value)
|
31
31
|
{
|
32
|
-
if (items.Count ==
|
32
|
+
if (items.Count == capacity)
|
33
33
|
{
|
34
34
|
throw new InvalidOperationException("Cannot write to full buffer");
|
35
35
|
}
|
@@ -37,9 +37,9 @@ public void Write(T value)
|
|
37
37
|
items.Add(value);
|
38
38
|
}
|
39
39
|
|
40
|
-
public void
|
40
|
+
public void Overwrite(T value)
|
41
41
|
{
|
42
|
-
if (items.Count ==
|
42
|
+
if (items.Count == capacity)
|
43
43
|
{
|
44
44
|
DequeueHead();
|
45
45
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// This file was auto-generated based on version
|
1
|
+
// This file was auto-generated based on version 2.2.1 of the canonical data.
|
2
2
|
|
3
3
|
using Xunit;
|
4
4
|
|
@@ -197,56 +197,56 @@ public void Add_more_than_two_days()
|
|
197
197
|
public void Subtract_minutes()
|
198
198
|
{
|
199
199
|
var sut = new Clock(10, 3);
|
200
|
-
Assert.Equal("10:00", sut.
|
200
|
+
Assert.Equal("10:00", sut.Subtract(3).ToString());
|
201
201
|
}
|
202
202
|
|
203
203
|
[Fact(Skip = "Remove to run test")]
|
204
204
|
public void Subtract_to_previous_hour()
|
205
205
|
{
|
206
206
|
var sut = new Clock(10, 3);
|
207
|
-
Assert.Equal("09:33", sut.
|
207
|
+
Assert.Equal("09:33", sut.Subtract(30).ToString());
|
208
208
|
}
|
209
209
|
|
210
210
|
[Fact(Skip = "Remove to run test")]
|
211
211
|
public void Subtract_more_than_an_hour()
|
212
212
|
{
|
213
213
|
var sut = new Clock(10, 3);
|
214
|
-
Assert.Equal("08:53", sut.
|
214
|
+
Assert.Equal("08:53", sut.Subtract(70).ToString());
|
215
215
|
}
|
216
216
|
|
217
217
|
[Fact(Skip = "Remove to run test")]
|
218
218
|
public void Subtract_across_midnight()
|
219
219
|
{
|
220
220
|
var sut = new Clock(0, 3);
|
221
|
-
Assert.Equal("23:59", sut.
|
221
|
+
Assert.Equal("23:59", sut.Subtract(4).ToString());
|
222
222
|
}
|
223
223
|
|
224
224
|
[Fact(Skip = "Remove to run test")]
|
225
225
|
public void Subtract_more_than_two_hours()
|
226
226
|
{
|
227
227
|
var sut = new Clock(0, 0);
|
228
|
-
Assert.Equal("21:20", sut.
|
228
|
+
Assert.Equal("21:20", sut.Subtract(160).ToString());
|
229
229
|
}
|
230
230
|
|
231
231
|
[Fact(Skip = "Remove to run test")]
|
232
232
|
public void Subtract_more_than_two_hours_with_borrow()
|
233
233
|
{
|
234
234
|
var sut = new Clock(6, 15);
|
235
|
-
Assert.Equal("03:35", sut.
|
235
|
+
Assert.Equal("03:35", sut.Subtract(160).ToString());
|
236
236
|
}
|
237
237
|
|
238
238
|
[Fact(Skip = "Remove to run test")]
|
239
239
|
public void Subtract_more_than_one_day_1500_min_25_hrs_()
|
240
240
|
{
|
241
241
|
var sut = new Clock(5, 32);
|
242
|
-
Assert.Equal("04:32", sut.
|
242
|
+
Assert.Equal("04:32", sut.Subtract(1500).ToString());
|
243
243
|
}
|
244
244
|
|
245
245
|
[Fact(Skip = "Remove to run test")]
|
246
246
|
public void Subtract_more_than_two_days()
|
247
247
|
{
|
248
248
|
var sut = new Clock(2, 20);
|
249
|
-
Assert.Equal("00:20", sut.
|
249
|
+
Assert.Equal("00:20", sut.Subtract(3000).ToString());
|
250
250
|
}
|
251
251
|
|
252
252
|
[Fact(Skip = "Remove to run test")]
|
@@ -259,98 +259,98 @@ public void Clocks_with_same_time()
|
|
259
259
|
[Fact(Skip = "Remove to run test")]
|
260
260
|
public void Clocks_a_minute_apart()
|
261
261
|
{
|
262
|
-
var sut = new Clock(15,
|
263
|
-
Assert.NotEqual(new Clock(15,
|
262
|
+
var sut = new Clock(15, 37);
|
263
|
+
Assert.NotEqual(new Clock(15, 36), sut);
|
264
264
|
}
|
265
265
|
|
266
266
|
[Fact(Skip = "Remove to run test")]
|
267
267
|
public void Clocks_an_hour_apart()
|
268
268
|
{
|
269
|
-
var sut = new Clock(
|
270
|
-
Assert.NotEqual(new Clock(
|
269
|
+
var sut = new Clock(15, 37);
|
270
|
+
Assert.NotEqual(new Clock(14, 37), sut);
|
271
271
|
}
|
272
272
|
|
273
273
|
[Fact(Skip = "Remove to run test")]
|
274
274
|
public void Clocks_with_hour_overflow()
|
275
275
|
{
|
276
|
-
var sut = new Clock(
|
277
|
-
Assert.Equal(new Clock(
|
276
|
+
var sut = new Clock(34, 37);
|
277
|
+
Assert.Equal(new Clock(10, 37), sut);
|
278
278
|
}
|
279
279
|
|
280
280
|
[Fact(Skip = "Remove to run test")]
|
281
281
|
public void Clocks_with_hour_overflow_by_several_days()
|
282
282
|
{
|
283
|
-
var sut = new Clock(
|
284
|
-
Assert.Equal(new Clock(
|
283
|
+
var sut = new Clock(99, 11);
|
284
|
+
Assert.Equal(new Clock(3, 11), sut);
|
285
285
|
}
|
286
286
|
|
287
287
|
[Fact(Skip = "Remove to run test")]
|
288
288
|
public void Clocks_with_negative_hour()
|
289
289
|
{
|
290
|
-
var sut = new Clock(
|
291
|
-
Assert.Equal(new Clock(
|
290
|
+
var sut = new Clock(-2, 40);
|
291
|
+
Assert.Equal(new Clock(22, 40), sut);
|
292
292
|
}
|
293
293
|
|
294
294
|
[Fact(Skip = "Remove to run test")]
|
295
295
|
public void Clocks_with_negative_hour_that_wraps()
|
296
296
|
{
|
297
|
-
var sut = new Clock(
|
298
|
-
Assert.Equal(new Clock(
|
297
|
+
var sut = new Clock(-31, 3);
|
298
|
+
Assert.Equal(new Clock(17, 3), sut);
|
299
299
|
}
|
300
300
|
|
301
301
|
[Fact(Skip = "Remove to run test")]
|
302
302
|
public void Clocks_with_negative_hour_that_wraps_multiple_times()
|
303
303
|
{
|
304
|
-
var sut = new Clock(
|
305
|
-
Assert.Equal(new Clock(
|
304
|
+
var sut = new Clock(-83, 49);
|
305
|
+
Assert.Equal(new Clock(13, 49), sut);
|
306
306
|
}
|
307
307
|
|
308
308
|
[Fact(Skip = "Remove to run test")]
|
309
309
|
public void Clocks_with_minute_overflow()
|
310
310
|
{
|
311
|
-
var sut = new Clock(0,
|
312
|
-
Assert.Equal(new Clock(0,
|
311
|
+
var sut = new Clock(0, 1441);
|
312
|
+
Assert.Equal(new Clock(0, 1), sut);
|
313
313
|
}
|
314
314
|
|
315
315
|
[Fact(Skip = "Remove to run test")]
|
316
316
|
public void Clocks_with_minute_overflow_by_several_days()
|
317
317
|
{
|
318
|
-
var sut = new Clock(2,
|
319
|
-
Assert.Equal(new Clock(2,
|
318
|
+
var sut = new Clock(2, 4322);
|
319
|
+
Assert.Equal(new Clock(2, 2), sut);
|
320
320
|
}
|
321
321
|
|
322
322
|
[Fact(Skip = "Remove to run test")]
|
323
323
|
public void Clocks_with_negative_minute()
|
324
324
|
{
|
325
|
-
var sut = new Clock(
|
326
|
-
Assert.Equal(new Clock(
|
325
|
+
var sut = new Clock(3, -20);
|
326
|
+
Assert.Equal(new Clock(2, 40), sut);
|
327
327
|
}
|
328
328
|
|
329
329
|
[Fact(Skip = "Remove to run test")]
|
330
330
|
public void Clocks_with_negative_minute_that_wraps()
|
331
331
|
{
|
332
|
-
var sut = new Clock(
|
333
|
-
Assert.Equal(new Clock(
|
332
|
+
var sut = new Clock(5, -1490);
|
333
|
+
Assert.Equal(new Clock(4, 10), sut);
|
334
334
|
}
|
335
335
|
|
336
336
|
[Fact(Skip = "Remove to run test")]
|
337
337
|
public void Clocks_with_negative_minute_that_wraps_multiple_times()
|
338
338
|
{
|
339
|
-
var sut = new Clock(6,
|
340
|
-
Assert.Equal(new Clock(6,
|
339
|
+
var sut = new Clock(6, -4305);
|
340
|
+
Assert.Equal(new Clock(6, 15), sut);
|
341
341
|
}
|
342
342
|
|
343
343
|
[Fact(Skip = "Remove to run test")]
|
344
344
|
public void Clocks_with_negative_hours_and_minutes()
|
345
345
|
{
|
346
|
-
var sut = new Clock(
|
347
|
-
Assert.Equal(new Clock(
|
346
|
+
var sut = new Clock(-12, -268);
|
347
|
+
Assert.Equal(new Clock(7, 32), sut);
|
348
348
|
}
|
349
349
|
|
350
350
|
[Fact(Skip = "Remove to run test")]
|
351
351
|
public void Clocks_with_negative_hours_and_minutes_that_wrap()
|
352
352
|
{
|
353
|
-
var sut = new Clock(
|
354
|
-
Assert.Equal(new Clock(
|
353
|
+
var sut = new Clock(-54, -11513);
|
354
|
+
Assert.Equal(new Clock(18, 7), sut);
|
355
355
|
}
|
356
356
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// This file was auto-generated based on version 1.
|
1
|
+
// This file was auto-generated based on version 1.3.0 of the canonical data.
|
2
2
|
|
3
3
|
using Xunit;
|
4
4
|
using System;
|
@@ -6,6 +6,15 @@
|
|
6
6
|
public class ComplexNumbersTest
|
7
7
|
{
|
8
8
|
[Fact]
|
9
|
+
public void Imaginary_unit()
|
10
|
+
{
|
11
|
+
var sut = new ComplexNumber(0, 1);
|
12
|
+
var expected = new ComplexNumber(-1, 0);
|
13
|
+
Assert.Equal(expected.Real(), sut.Mul(new ComplexNumber(0, 1)).Real(), precision: 15);
|
14
|
+
Assert.Equal(expected.Imaginary(), sut.Mul(new ComplexNumber(0, 1)).Imaginary(), precision: 15);
|
15
|
+
}
|
16
|
+
|
17
|
+
[Fact(Skip = "Remove to run test")]
|
9
18
|
public void Real_part_of_a_purely_real_number()
|
10
19
|
{
|
11
20
|
var sut = new ComplexNumber(1, 0);
|
@@ -47,15 +56,6 @@ public void Imaginary_part_of_a_number_with_real_and_imaginary_part()
|
|
47
56
|
Assert.Equal(2, sut.Imaginary());
|
48
57
|
}
|
49
58
|
|
50
|
-
[Fact(Skip = "Remove to run test")]
|
51
|
-
public void Imaginary_unit()
|
52
|
-
{
|
53
|
-
var sut = new ComplexNumber(0, 1);
|
54
|
-
var expected = new ComplexNumber(-1, 0);
|
55
|
-
Assert.Equal(expected.Real(), sut.Mul(new ComplexNumber(0, 1)).Real(), precision: 15);
|
56
|
-
Assert.Equal(expected.Imaginary(), sut.Mul(new ComplexNumber(0, 1)).Imaginary(), precision: 15);
|
57
|
-
}
|
58
|
-
|
59
59
|
[Fact(Skip = "Remove to run test")]
|
60
60
|
public void Add_purely_real_numbers()
|
61
61
|
{
|
@@ -252,4 +252,13 @@ public void Exponential_of_a_purely_real_number()
|
|
252
252
|
Assert.Equal(expected.Real(), sut.Exp().Real(), precision: 15);
|
253
253
|
Assert.Equal(expected.Imaginary(), sut.Exp().Imaginary(), precision: 15);
|
254
254
|
}
|
255
|
+
|
256
|
+
[Fact(Skip = "Remove to run test")]
|
257
|
+
public void Exponential_of_a_number_with_real_and_imaginary_part()
|
258
|
+
{
|
259
|
+
var sut = new ComplexNumber(Math.Log(2.0), Math.PI);
|
260
|
+
var expected = new ComplexNumber(-2, 0);
|
261
|
+
Assert.Equal(expected.Real(), sut.Exp().Real(), precision: 15);
|
262
|
+
Assert.Equal(expected.Imaginary(), sut.Exp().Imaginary(), precision: 15);
|
263
|
+
}
|
255
264
|
}
|
@@ -1,4 +1,4 @@
|
|
1
1
|
## Hints
|
2
|
-
|
3
|
-
|
4
|
-
(https://docs.microsoft.com/en-us/dotnet/
|
2
|
+
|
3
|
+
This exercise requires you to create custom equality comparison logic.
|
4
|
+
For more information, see [this page](https://docs.microsoft.com/en-us/dotnet/api/system.object.equals?view=netcore-2.0#System_Object_Equals_System_Object_).
|
@@ -1,88 +1,49 @@
|
|
1
1
|
using System;
|
2
|
-
using System.Collections;
|
3
|
-
using System.Collections.Generic;
|
4
2
|
|
5
|
-
public class CustomSet
|
3
|
+
public class CustomSet
|
6
4
|
{
|
7
|
-
public CustomSet()
|
8
|
-
{
|
9
|
-
}
|
10
|
-
|
11
|
-
public CustomSet(T value)
|
12
|
-
{
|
13
|
-
}
|
14
|
-
|
15
|
-
public CustomSet(IEnumerable<T> values)
|
16
|
-
{
|
17
|
-
}
|
18
|
-
|
19
|
-
public CustomSet<T> Insert(T value)
|
20
|
-
{
|
21
|
-
throw new NotImplementedException("You need to implement this function.");
|
22
|
-
}
|
23
|
-
|
24
|
-
public bool IsEmpty()
|
5
|
+
public CustomSet(params int[] values)
|
25
6
|
{
|
26
7
|
throw new NotImplementedException("You need to implement this function.");
|
27
8
|
}
|
28
9
|
|
29
|
-
public
|
10
|
+
public CustomSet Insert(int value)
|
30
11
|
{
|
31
12
|
throw new NotImplementedException("You need to implement this function.");
|
32
13
|
}
|
33
14
|
|
34
|
-
public bool
|
15
|
+
public bool Empty()
|
35
16
|
{
|
36
17
|
throw new NotImplementedException("You need to implement this function.");
|
37
18
|
}
|
38
19
|
|
39
|
-
public bool
|
20
|
+
public bool Contains(int value)
|
40
21
|
{
|
41
22
|
throw new NotImplementedException("You need to implement this function.");
|
42
23
|
}
|
43
24
|
|
44
|
-
public
|
25
|
+
public bool Subset(CustomSet right)
|
45
26
|
{
|
46
27
|
throw new NotImplementedException("You need to implement this function.");
|
47
28
|
}
|
48
29
|
|
49
|
-
public
|
30
|
+
public bool Disjoint(CustomSet right)
|
50
31
|
{
|
51
32
|
throw new NotImplementedException("You need to implement this function.");
|
52
33
|
}
|
53
34
|
|
54
|
-
public CustomSet
|
35
|
+
public CustomSet Intersection(CustomSet right)
|
55
36
|
{
|
56
37
|
throw new NotImplementedException("You need to implement this function.");
|
57
38
|
}
|
58
39
|
|
59
|
-
public
|
40
|
+
public CustomSet Difference(CustomSet right)
|
60
41
|
{
|
61
42
|
throw new NotImplementedException("You need to implement this function.");
|
62
43
|
}
|
63
44
|
|
64
|
-
|
45
|
+
public CustomSet Union(CustomSet right)
|
65
46
|
{
|
66
47
|
throw new NotImplementedException("You need to implement this function.");
|
67
48
|
}
|
68
|
-
|
69
|
-
public override bool Equals(object obj)
|
70
|
-
{
|
71
|
-
throw new NotImplementedException("You need to implement this function.");
|
72
|
-
}
|
73
|
-
|
74
|
-
public override int GetHashCode()
|
75
|
-
{
|
76
|
-
throw new NotImplementedException();
|
77
|
-
}
|
78
|
-
|
79
|
-
public bool Equals(IEnumerable<T> other)
|
80
|
-
{
|
81
|
-
throw new NotImplementedException("You need to implement this function.");
|
82
|
-
}
|
83
|
-
|
84
|
-
public int GetHashCode(IEnumerable<T> obj)
|
85
|
-
{
|
86
|
-
throw new NotImplementedException();
|
87
|
-
}
|
88
49
|
}
|
@@ -1,312 +1,308 @@
|
|
1
|
-
|
1
|
+
// This file was auto-generated based on version 1.3.0 of the canonical data.
|
2
|
+
|
3
|
+
using Xunit;
|
2
4
|
|
3
5
|
public class CustomSetTest
|
4
6
|
{
|
5
7
|
[Fact]
|
6
8
|
public void Sets_with_no_elements_are_empty()
|
7
9
|
{
|
8
|
-
var
|
9
|
-
Assert.True(
|
10
|
+
var sut = new CustomSet();
|
11
|
+
Assert.True(sut.Empty());
|
10
12
|
}
|
11
13
|
|
12
14
|
[Fact(Skip = "Remove to run test")]
|
13
15
|
public void Sets_with_elements_are_not_empty()
|
14
16
|
{
|
15
|
-
var
|
16
|
-
Assert.False(
|
17
|
+
var sut = new CustomSet(new[] { 1 });
|
18
|
+
Assert.False(sut.Empty());
|
17
19
|
}
|
18
20
|
|
19
21
|
[Fact(Skip = "Remove to run test")]
|
20
22
|
public void Nothing_is_contained_in_an_empty_set()
|
21
23
|
{
|
22
|
-
var
|
23
|
-
|
24
|
+
var element = 1;
|
25
|
+
var sut = new CustomSet();
|
26
|
+
Assert.False(sut.Contains(element));
|
24
27
|
}
|
25
28
|
|
26
29
|
[Fact(Skip = "Remove to run test")]
|
27
|
-
public void
|
30
|
+
public void When_the_element_is_in_the_set()
|
28
31
|
{
|
29
|
-
var
|
30
|
-
|
32
|
+
var element = 1;
|
33
|
+
var sut = new CustomSet(new[] { 1, 2, 3 });
|
34
|
+
Assert.True(sut.Contains(element));
|
31
35
|
}
|
32
36
|
|
33
37
|
[Fact(Skip = "Remove to run test")]
|
34
|
-
public void
|
38
|
+
public void When_the_element_is_not_in_the_set()
|
35
39
|
{
|
36
|
-
var
|
37
|
-
|
40
|
+
var element = 4;
|
41
|
+
var sut = new CustomSet(new[] { 1, 2, 3 });
|
42
|
+
Assert.False(sut.Contains(element));
|
38
43
|
}
|
39
44
|
|
40
45
|
[Fact(Skip = "Remove to run test")]
|
41
|
-
public void
|
46
|
+
public void Empty_set_is_a_subset_of_another_empty_set()
|
42
47
|
{
|
43
|
-
var
|
44
|
-
|
45
|
-
|
46
|
-
Assert.True(expected.Equals(actual));
|
48
|
+
var set2 = new CustomSet();
|
49
|
+
var sut = new CustomSet();
|
50
|
+
Assert.True(sut.Subset(set2));
|
47
51
|
}
|
48
52
|
|
49
53
|
[Fact(Skip = "Remove to run test")]
|
50
|
-
public void
|
54
|
+
public void Empty_set_is_a_subset_of_non_empty_set()
|
51
55
|
{
|
52
|
-
var
|
53
|
-
|
54
|
-
|
55
|
-
Assert.True(expected.Equals(actual));
|
56
|
+
var set2 = new CustomSet(new[] { 1 });
|
57
|
+
var sut = new CustomSet();
|
58
|
+
Assert.True(sut.Subset(set2));
|
56
59
|
}
|
57
60
|
|
58
61
|
[Fact(Skip = "Remove to run test")]
|
59
|
-
public void
|
62
|
+
public void Non_empty_set_is_not_a_subset_of_empty_set()
|
60
63
|
{
|
61
|
-
var
|
62
|
-
|
64
|
+
var set2 = new CustomSet();
|
65
|
+
var sut = new CustomSet(new[] { 1 });
|
66
|
+
Assert.False(sut.Subset(set2));
|
67
|
+
}
|
63
68
|
|
64
|
-
|
65
|
-
|
69
|
+
[Fact(Skip = "Remove to run test")]
|
70
|
+
public void Set_is_a_subset_of_set_with_exact_same_elements()
|
71
|
+
{
|
72
|
+
var set2 = new CustomSet(new[] { 1, 2, 3 });
|
73
|
+
var sut = new CustomSet(new[] { 1, 2, 3 });
|
74
|
+
Assert.True(sut.Subset(set2));
|
66
75
|
}
|
67
76
|
|
68
77
|
[Fact(Skip = "Remove to run test")]
|
69
|
-
public void
|
78
|
+
public void Set_is_a_subset_of_larger_set_with_same_elements()
|
70
79
|
{
|
71
|
-
var
|
72
|
-
var
|
73
|
-
Assert.True(
|
80
|
+
var set2 = new CustomSet(new[] { 4, 1, 2, 3 });
|
81
|
+
var sut = new CustomSet(new[] { 1, 2, 3 });
|
82
|
+
Assert.True(sut.Subset(set2));
|
74
83
|
}
|
75
84
|
|
76
85
|
[Fact(Skip = "Remove to run test")]
|
77
|
-
public void
|
86
|
+
public void Set_is_not_a_subset_of_set_that_does_not_contain_its_elements()
|
78
87
|
{
|
79
|
-
var
|
80
|
-
var
|
81
|
-
Assert.
|
88
|
+
var set2 = new CustomSet(new[] { 4, 1, 3 });
|
89
|
+
var sut = new CustomSet(new[] { 1, 2, 3 });
|
90
|
+
Assert.False(sut.Subset(set2));
|
82
91
|
}
|
83
92
|
|
84
93
|
[Fact(Skip = "Remove to run test")]
|
85
|
-
public void
|
94
|
+
public void The_empty_set_is_disjoint_with_itself()
|
86
95
|
{
|
87
|
-
var
|
88
|
-
var
|
89
|
-
Assert.
|
96
|
+
var set2 = new CustomSet();
|
97
|
+
var sut = new CustomSet();
|
98
|
+
Assert.True(sut.Disjoint(set2));
|
90
99
|
}
|
91
100
|
|
92
101
|
[Fact(Skip = "Remove to run test")]
|
93
|
-
public void
|
102
|
+
public void Empty_set_is_disjoint_with_non_empty_set()
|
94
103
|
{
|
95
|
-
var
|
96
|
-
var
|
97
|
-
Assert.True(
|
104
|
+
var set2 = new CustomSet(new[] { 1 });
|
105
|
+
var sut = new CustomSet();
|
106
|
+
Assert.True(sut.Disjoint(set2));
|
98
107
|
}
|
99
108
|
|
100
109
|
[Fact(Skip = "Remove to run test")]
|
101
|
-
public void
|
110
|
+
public void Non_empty_set_is_disjoint_with_empty_set()
|
102
111
|
{
|
103
|
-
var
|
104
|
-
var
|
105
|
-
Assert.True(
|
112
|
+
var set2 = new CustomSet();
|
113
|
+
var sut = new CustomSet(new[] { 1 });
|
114
|
+
Assert.True(sut.Disjoint(set2));
|
106
115
|
}
|
107
116
|
|
108
117
|
[Fact(Skip = "Remove to run test")]
|
109
|
-
public void
|
118
|
+
public void Sets_are_not_disjoint_if_they_share_an_element()
|
110
119
|
{
|
111
|
-
var
|
112
|
-
var
|
113
|
-
Assert.False(
|
120
|
+
var set2 = new CustomSet(new[] { 2, 3 });
|
121
|
+
var sut = new CustomSet(new[] { 1, 2 });
|
122
|
+
Assert.False(sut.Disjoint(set2));
|
114
123
|
}
|
115
124
|
|
116
125
|
[Fact(Skip = "Remove to run test")]
|
117
|
-
public void
|
126
|
+
public void Sets_are_disjoint_if_they_share_no_elements()
|
118
127
|
{
|
119
|
-
var
|
120
|
-
var
|
121
|
-
Assert.True(
|
128
|
+
var set2 = new CustomSet(new[] { 3, 4 });
|
129
|
+
var sut = new CustomSet(new[] { 1, 2 });
|
130
|
+
Assert.True(sut.Disjoint(set2));
|
122
131
|
}
|
123
132
|
|
124
133
|
[Fact(Skip = "Remove to run test")]
|
125
|
-
public void
|
134
|
+
public void Empty_sets_are_equal()
|
126
135
|
{
|
127
|
-
var
|
128
|
-
var
|
129
|
-
Assert.True(
|
136
|
+
var set2 = new CustomSet();
|
137
|
+
var sut = new CustomSet();
|
138
|
+
Assert.True(sut.Equals(set2));
|
130
139
|
}
|
131
140
|
|
132
141
|
[Fact(Skip = "Remove to run test")]
|
133
|
-
public void
|
142
|
+
public void Empty_set_is_not_equal_to_non_empty_set()
|
134
143
|
{
|
135
|
-
var
|
136
|
-
var
|
137
|
-
Assert.
|
144
|
+
var set2 = new CustomSet(new[] { 1, 2, 3 });
|
145
|
+
var sut = new CustomSet();
|
146
|
+
Assert.False(sut.Equals(set2));
|
138
147
|
}
|
139
148
|
|
140
149
|
[Fact(Skip = "Remove to run test")]
|
141
|
-
public void
|
150
|
+
public void Non_empty_set_is_not_equal_to_empty_set()
|
142
151
|
{
|
143
|
-
var
|
144
|
-
var
|
145
|
-
Assert.False(
|
152
|
+
var set2 = new CustomSet();
|
153
|
+
var sut = new CustomSet(new[] { 1, 2, 3 });
|
154
|
+
Assert.False(sut.Equals(set2));
|
146
155
|
}
|
147
156
|
|
148
157
|
[Fact(Skip = "Remove to run test")]
|
149
|
-
public void
|
158
|
+
public void Sets_with_the_same_elements_are_equal()
|
150
159
|
{
|
151
|
-
var
|
152
|
-
var
|
153
|
-
Assert.True(
|
160
|
+
var set2 = new CustomSet(new[] { 2, 1 });
|
161
|
+
var sut = new CustomSet(new[] { 1, 2 });
|
162
|
+
Assert.True(sut.Equals(set2));
|
154
163
|
}
|
155
164
|
|
156
165
|
[Fact(Skip = "Remove to run test")]
|
157
|
-
public void
|
166
|
+
public void Sets_with_different_elements_are_not_equal()
|
158
167
|
{
|
159
|
-
var
|
160
|
-
var
|
161
|
-
|
162
|
-
Assert.True(left.Intersection(right).Equals(expected));
|
168
|
+
var set2 = new CustomSet(new[] { 1, 2, 4 });
|
169
|
+
var sut = new CustomSet(new[] { 1, 2, 3 });
|
170
|
+
Assert.False(sut.Equals(set2));
|
163
171
|
}
|
164
172
|
|
165
173
|
[Fact(Skip = "Remove to run test")]
|
166
|
-
public void
|
174
|
+
public void Set_is_not_equal_to_larger_set_with_same_elements()
|
167
175
|
{
|
168
|
-
var
|
169
|
-
var
|
170
|
-
|
171
|
-
Assert.True(left.Intersection(right).Equals(expected));
|
176
|
+
var set2 = new CustomSet(new[] { 1, 2, 3, 4 });
|
177
|
+
var sut = new CustomSet(new[] { 1, 2, 3 });
|
178
|
+
Assert.False(sut.Equals(set2));
|
172
179
|
}
|
173
180
|
|
174
181
|
[Fact(Skip = "Remove to run test")]
|
175
|
-
public void
|
182
|
+
public void Add_to_empty_set()
|
176
183
|
{
|
177
|
-
var
|
178
|
-
var
|
179
|
-
|
180
|
-
Assert.True(left.Intersection(right).Equals(expected));
|
184
|
+
var element = 3;
|
185
|
+
var sut = new CustomSet();
|
186
|
+
Assert.Equal(new CustomSet(new[] { 3 }), sut.Add(element));
|
181
187
|
}
|
182
188
|
|
183
189
|
[Fact(Skip = "Remove to run test")]
|
184
|
-
public void
|
190
|
+
public void Add_to_non_empty_set()
|
185
191
|
{
|
186
|
-
var
|
187
|
-
var
|
188
|
-
|
189
|
-
Assert.True(left.Intersection(right).Equals(expected));
|
192
|
+
var element = 3;
|
193
|
+
var sut = new CustomSet(new[] { 1, 2, 4 });
|
194
|
+
Assert.Equal(new CustomSet(new[] { 1, 2, 3, 4 }), sut.Add(element));
|
190
195
|
}
|
191
196
|
|
192
197
|
[Fact(Skip = "Remove to run test")]
|
193
|
-
public void
|
198
|
+
public void Adding_an_existing_element_does_not_change_the_set()
|
194
199
|
{
|
195
|
-
var
|
196
|
-
var
|
197
|
-
|
198
|
-
Assert.True(left.Intersection(right).Equals(expected));
|
200
|
+
var element = 3;
|
201
|
+
var sut = new CustomSet(new[] { 1, 2, 3 });
|
202
|
+
Assert.Equal(new CustomSet(new[] { 1, 2, 3 }), sut.Add(element));
|
199
203
|
}
|
200
204
|
|
201
205
|
[Fact(Skip = "Remove to run test")]
|
202
|
-
public void
|
206
|
+
public void Intersection_of_two_empty_sets_is_an_empty_set()
|
203
207
|
{
|
204
|
-
var
|
205
|
-
var
|
206
|
-
|
207
|
-
Assert.True(left.Difference(right).Equals(expected));
|
208
|
+
var set2 = new CustomSet();
|
209
|
+
var sut = new CustomSet();
|
210
|
+
Assert.Equal(new CustomSet(), sut.Intersection(set2));
|
208
211
|
}
|
209
212
|
|
210
213
|
[Fact(Skip = "Remove to run test")]
|
211
|
-
public void
|
214
|
+
public void Intersection_of_an_empty_set_and_non_empty_set_is_an_empty_set()
|
212
215
|
{
|
213
|
-
var
|
214
|
-
var
|
215
|
-
|
216
|
-
Assert.True(left.Difference(right).Equals(expected));
|
216
|
+
var set2 = new CustomSet(new[] { 3, 2, 5 });
|
217
|
+
var sut = new CustomSet();
|
218
|
+
Assert.Equal(new CustomSet(), sut.Intersection(set2));
|
217
219
|
}
|
218
220
|
|
219
221
|
[Fact(Skip = "Remove to run test")]
|
220
|
-
public void
|
222
|
+
public void Intersection_of_a_non_empty_set_and_an_empty_set_is_an_empty_set()
|
221
223
|
{
|
222
|
-
var
|
223
|
-
var
|
224
|
-
|
225
|
-
Assert.True(left.Difference(right).Equals(expected));
|
224
|
+
var set2 = new CustomSet();
|
225
|
+
var sut = new CustomSet(new[] { 1, 2, 3, 4 });
|
226
|
+
Assert.Equal(new CustomSet(), sut.Intersection(set2));
|
226
227
|
}
|
227
228
|
|
228
229
|
[Fact(Skip = "Remove to run test")]
|
229
|
-
public void
|
230
|
+
public void Intersection_of_two_sets_with_no_shared_elements_is_an_empty_set()
|
230
231
|
{
|
231
|
-
var
|
232
|
-
var
|
233
|
-
|
234
|
-
Assert.True(left.Difference(right).Equals(expected));
|
232
|
+
var set2 = new CustomSet(new[] { 4, 5, 6 });
|
233
|
+
var sut = new CustomSet(new[] { 1, 2, 3 });
|
234
|
+
Assert.Equal(new CustomSet(), sut.Intersection(set2));
|
235
235
|
}
|
236
236
|
|
237
237
|
[Fact(Skip = "Remove to run test")]
|
238
|
-
public void
|
238
|
+
public void Intersection_of_two_sets_with_shared_elements_is_a_set_of_the_shared_elements()
|
239
239
|
{
|
240
|
-
var
|
241
|
-
var
|
242
|
-
|
243
|
-
Assert.True(left.Union(right).Equals(expected));
|
240
|
+
var set2 = new CustomSet(new[] { 3, 2, 5 });
|
241
|
+
var sut = new CustomSet(new[] { 1, 2, 3, 4 });
|
242
|
+
Assert.Equal(new CustomSet(new[] { 2, 3 }), sut.Intersection(set2));
|
244
243
|
}
|
245
244
|
|
246
245
|
[Fact(Skip = "Remove to run test")]
|
247
|
-
public void
|
246
|
+
public void Difference_of_two_empty_sets_is_an_empty_set()
|
248
247
|
{
|
249
|
-
var
|
250
|
-
var
|
251
|
-
|
252
|
-
Assert.True(left.Union(right).Equals(expected));
|
248
|
+
var set2 = new CustomSet();
|
249
|
+
var sut = new CustomSet();
|
250
|
+
Assert.Equal(new CustomSet(), sut.Difference(set2));
|
253
251
|
}
|
254
252
|
|
255
253
|
[Fact(Skip = "Remove to run test")]
|
256
|
-
public void
|
254
|
+
public void Difference_of_empty_set_and_non_empty_set_is_an_empty_set()
|
257
255
|
{
|
258
|
-
var
|
259
|
-
var
|
260
|
-
|
261
|
-
Assert.True(left.Union(right).Equals(expected));
|
256
|
+
var set2 = new CustomSet(new[] { 3, 2, 5 });
|
257
|
+
var sut = new CustomSet();
|
258
|
+
Assert.Equal(new CustomSet(), sut.Difference(set2));
|
262
259
|
}
|
263
260
|
|
264
261
|
[Fact(Skip = "Remove to run test")]
|
265
|
-
public void
|
262
|
+
public void Difference_of_a_non_empty_set_and_an_empty_set_is_the_non_empty_set()
|
266
263
|
{
|
267
|
-
var
|
268
|
-
var
|
269
|
-
|
270
|
-
Assert.True(left.Union(right).Equals(expected));
|
264
|
+
var set2 = new CustomSet();
|
265
|
+
var sut = new CustomSet(new[] { 1, 2, 3, 4 });
|
266
|
+
Assert.Equal(new CustomSet(new[] { 1, 2, 3, 4 }), sut.Difference(set2));
|
271
267
|
}
|
272
268
|
|
273
269
|
[Fact(Skip = "Remove to run test")]
|
274
|
-
public void
|
270
|
+
public void Difference_of_two_non_empty_sets_is_a_set_of_elements_that_are_only_in_the_first_set()
|
275
271
|
{
|
276
|
-
var
|
277
|
-
var
|
278
|
-
Assert.
|
272
|
+
var set2 = new CustomSet(new[] { 2, 4 });
|
273
|
+
var sut = new CustomSet(new[] { 3, 2, 1 });
|
274
|
+
Assert.Equal(new CustomSet(new[] { 1, 3 }), sut.Difference(set2));
|
279
275
|
}
|
280
276
|
|
281
277
|
[Fact(Skip = "Remove to run test")]
|
282
|
-
public void
|
278
|
+
public void Union_of_empty_sets_is_an_empty_set()
|
283
279
|
{
|
284
|
-
var
|
285
|
-
var
|
286
|
-
Assert.
|
280
|
+
var set2 = new CustomSet();
|
281
|
+
var sut = new CustomSet();
|
282
|
+
Assert.Equal(new CustomSet(), sut.Union(set2));
|
287
283
|
}
|
288
284
|
|
289
285
|
[Fact(Skip = "Remove to run test")]
|
290
|
-
public void
|
286
|
+
public void Union_of_an_empty_set_and_non_empty_set_is_the_non_empty_set()
|
291
287
|
{
|
292
|
-
var
|
293
|
-
var
|
294
|
-
Assert.
|
288
|
+
var set2 = new CustomSet(new[] { 2 });
|
289
|
+
var sut = new CustomSet();
|
290
|
+
Assert.Equal(new CustomSet(new[] { 2 }), sut.Union(set2));
|
295
291
|
}
|
296
292
|
|
297
293
|
[Fact(Skip = "Remove to run test")]
|
298
|
-
public void
|
294
|
+
public void Union_of_a_non_empty_set_and_empty_set_is_the_non_empty_set()
|
299
295
|
{
|
300
|
-
var
|
301
|
-
var
|
302
|
-
Assert.
|
296
|
+
var set2 = new CustomSet();
|
297
|
+
var sut = new CustomSet(new[] { 1, 3 });
|
298
|
+
Assert.Equal(new CustomSet(new[] { 1, 3 }), sut.Union(set2));
|
303
299
|
}
|
304
300
|
|
305
301
|
[Fact(Skip = "Remove to run test")]
|
306
|
-
public void
|
302
|
+
public void Union_of_non_empty_sets_contains_all_unique_elements()
|
307
303
|
{
|
308
|
-
var
|
309
|
-
var
|
310
|
-
Assert.
|
304
|
+
var set2 = new CustomSet(new[] { 2, 3 });
|
305
|
+
var sut = new CustomSet(new[] { 1, 3 });
|
306
|
+
Assert.Equal(new CustomSet(new[] { 3, 2, 1 }), sut.Union(set2));
|
311
307
|
}
|
312
308
|
}
|