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