trackler 2.2.1.33 → 2.2.1.34
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/README.md +1 -1
- data/problem-specifications/exercises/palindrome-products/description.md +9 -3
- data/tracks/c/exercises/hamming/src/example.c +9 -8
- data/tracks/c/exercises/hamming/src/example.h +1 -1
- data/tracks/c/exercises/hamming/test/test_hamming.c +31 -7
- data/tracks/clojure/config.json +10 -0
- data/tracks/clojure/exercises/collatz-conjecture/README.md +34 -0
- data/tracks/clojure/exercises/collatz-conjecture/project.clj +4 -0
- data/tracks/clojure/exercises/collatz-conjecture/src/collatz_conjecture.clj +3 -0
- data/tracks/clojure/exercises/collatz-conjecture/src/example.clj +13 -0
- data/tracks/clojure/exercises/collatz-conjecture/test/collatz_conjecture_test.clj +29 -0
- data/tracks/coldfusion/.gitignore +1 -0
- data/tracks/coldfusion/.travis.yml +16 -4
- data/tracks/coldfusion/CONTRIBUTING.md +10 -0
- data/tracks/coldfusion/README.md +85 -6
- data/tracks/coldfusion/config.json +195 -10
- data/tracks/coldfusion/config/maintainers.json +8 -1
- data/tracks/coldfusion/docs/ABOUT.md +8 -0
- data/tracks/coldfusion/docs/EXERCISE_README_INSERT.md +15 -0
- data/tracks/coldfusion/docs/INSTALLATION.md +35 -0
- data/tracks/coldfusion/docs/LEARNING.md +37 -0
- data/tracks/coldfusion/docs/RESOURCES.md +29 -0
- data/tracks/coldfusion/docs/SNIPPET.txt +8 -0
- data/tracks/coldfusion/docs/TESTS.md +19 -0
- data/tracks/coldfusion/exercises/acronym/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/acronym/Acronym.cfc +13 -0
- data/tracks/coldfusion/exercises/acronym/AcronymTest.cfc +43 -0
- data/tracks/coldfusion/exercises/acronym/Solution.cfc +22 -0
- data/tracks/coldfusion/exercises/acronym/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/acronym/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/acronym/box.json +8 -0
- data/tracks/coldfusion/exercises/acronym/index.cfm +37 -0
- data/tracks/coldfusion/exercises/atbash-cipher/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/atbash-cipher/AtbashCipher.cfc +14 -0
- data/tracks/coldfusion/exercises/atbash-cipher/AtbashCipherTest.cfc +71 -0
- data/tracks/coldfusion/exercises/atbash-cipher/Solution.cfc +56 -0
- data/tracks/coldfusion/exercises/atbash-cipher/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/atbash-cipher/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/atbash-cipher/box.json +8 -0
- data/tracks/coldfusion/exercises/atbash-cipher/index.cfm +37 -0
- data/tracks/coldfusion/exercises/diamond/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/diamond/Diamond.cfc +13 -0
- data/tracks/coldfusion/exercises/diamond/DiamondTest.cfc +35 -0
- data/tracks/coldfusion/exercises/diamond/Solution.cfc +35 -0
- data/tracks/coldfusion/exercises/diamond/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/diamond/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/diamond/box.json +8 -0
- data/tracks/coldfusion/exercises/diamond/index.cfm +37 -0
- data/tracks/coldfusion/exercises/difference-of-squares/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/difference-of-squares/DifferenceOfSquares.cfc +18 -0
- data/tracks/coldfusion/exercises/difference-of-squares/DifferenceOfSquaresTest.cfc +63 -0
- data/tracks/coldfusion/exercises/difference-of-squares/Solution.cfc +28 -0
- data/tracks/coldfusion/exercises/difference-of-squares/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/difference-of-squares/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/difference-of-squares/box.json +8 -0
- data/tracks/coldfusion/exercises/difference-of-squares/index.cfm +37 -0
- data/tracks/coldfusion/exercises/flatten-array/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/flatten-array/FlattenArray.cfc +13 -0
- data/tracks/coldfusion/exercises/flatten-array/FlattenArrayTest.cfc +42 -0
- data/tracks/coldfusion/exercises/flatten-array/Solution.cfc +26 -0
- data/tracks/coldfusion/exercises/flatten-array/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/flatten-array/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/flatten-array/box.json +8 -0
- data/tracks/coldfusion/exercises/flatten-array/index.cfm +37 -0
- data/tracks/coldfusion/exercises/gigasecond/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/gigasecond/Gigasecond.cfc +13 -0
- data/tracks/coldfusion/exercises/gigasecond/GigasecondTest.cfc +39 -0
- data/tracks/coldfusion/exercises/gigasecond/Solution.cfc +16 -0
- data/tracks/coldfusion/exercises/gigasecond/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/gigasecond/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/gigasecond/box.json +8 -0
- data/tracks/coldfusion/exercises/gigasecond/index.cfm +37 -0
- data/tracks/coldfusion/exercises/grains/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/grains/Grains.cfc +14 -0
- data/tracks/coldfusion/exercises/grains/GrainsTest.cfc +63 -0
- data/tracks/coldfusion/exercises/grains/Solution.cfc +22 -0
- data/tracks/coldfusion/exercises/grains/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/grains/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/grains/box.json +8 -0
- data/tracks/coldfusion/exercises/grains/index.cfm +37 -0
- data/tracks/coldfusion/exercises/hamming/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/hamming/Hamming.cfc +13 -0
- data/tracks/coldfusion/exercises/hamming/HammingTest.cfc +75 -0
- data/tracks/coldfusion/exercises/hamming/Solution.cfc +25 -0
- data/tracks/coldfusion/exercises/hamming/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/hamming/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/hamming/box.json +8 -0
- data/tracks/coldfusion/exercises/hamming/index.cfm +37 -0
- data/tracks/coldfusion/exercises/hello-world/HelloWorld.cfc +13 -0
- data/tracks/coldfusion/exercises/hello-world/HelloWorldTest.cfc +18 -0
- data/tracks/coldfusion/exercises/hello-world/Solution.cfc +13 -0
- data/tracks/coldfusion/exercises/hello-world/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/hello-world/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/hello-world/box.json +8 -0
- data/tracks/coldfusion/exercises/hello-world/index.cfm +37 -0
- data/tracks/coldfusion/exercises/isogram/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/isogram/Isogram.cfc +13 -0
- data/tracks/coldfusion/exercises/isogram/IsogramTest.cfc +55 -0
- data/tracks/coldfusion/exercises/isogram/Solution.cfc +23 -0
- data/tracks/coldfusion/exercises/isogram/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/isogram/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/isogram/box.json +8 -0
- data/tracks/coldfusion/exercises/isogram/index.cfm +37 -0
- data/tracks/coldfusion/exercises/largest-series-product/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/largest-series-product/LargestSeriesProduct.cfc +13 -0
- data/tracks/coldfusion/exercises/largest-series-product/LargestSeriesProductTest.cfc +75 -0
- data/tracks/coldfusion/exercises/largest-series-product/Solution.cfc +41 -0
- data/tracks/coldfusion/exercises/largest-series-product/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/largest-series-product/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/largest-series-product/box.json +8 -0
- data/tracks/coldfusion/exercises/largest-series-product/index.cfm +37 -0
- data/tracks/coldfusion/exercises/leap/Leap.cfc +15 -0
- data/tracks/coldfusion/exercises/leap/LeapTest.cfc +39 -0
- data/tracks/coldfusion/exercises/leap/Solution.cfc +19 -0
- data/tracks/coldfusion/exercises/leap/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/leap/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/leap/box.json +8 -0
- data/tracks/coldfusion/exercises/leap/index.cfm +37 -0
- data/tracks/coldfusion/exercises/luhn/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/luhn/Luhn.cfc +13 -0
- data/tracks/coldfusion/exercises/luhn/LuhnTest.cfc +67 -0
- data/tracks/coldfusion/exercises/luhn/Solution.cfc +38 -0
- data/tracks/coldfusion/exercises/luhn/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/luhn/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/luhn/box.json +8 -0
- data/tracks/coldfusion/exercises/luhn/index.cfm +37 -0
- data/tracks/coldfusion/exercises/nth-prime/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/nth-prime/NthPrime.cfc +13 -0
- data/tracks/coldfusion/exercises/nth-prime/NthPrimeTest.cfc +35 -0
- data/tracks/coldfusion/exercises/nth-prime/Solution.cfc +33 -0
- data/tracks/coldfusion/exercises/nth-prime/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/nth-prime/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/nth-prime/box.json +8 -0
- data/tracks/coldfusion/exercises/nth-prime/index.cfm +37 -0
- data/tracks/coldfusion/exercises/pangram/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/pangram/Pangram.cfc +13 -0
- data/tracks/coldfusion/exercises/pangram/PangramTest.cfc +55 -0
- data/tracks/coldfusion/exercises/pangram/Solution.cfc +21 -0
- data/tracks/coldfusion/exercises/pangram/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/pangram/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/pangram/box.json +8 -0
- data/tracks/coldfusion/exercises/pangram/index.cfm +37 -0
- data/tracks/coldfusion/exercises/pig-latin/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/pig-latin/PigLatin.cfc +13 -0
- data/tracks/coldfusion/exercises/pig-latin/PigLatinTest.cfc +115 -0
- data/tracks/coldfusion/exercises/pig-latin/Solution.cfc +30 -0
- data/tracks/coldfusion/exercises/pig-latin/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/pig-latin/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/pig-latin/box.json +8 -0
- data/tracks/coldfusion/exercises/pig-latin/index.cfm +37 -0
- data/tracks/coldfusion/exercises/raindrops/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/raindrops/Raindrops.cfc +13 -0
- data/tracks/coldfusion/exercises/raindrops/RaindropsTest.cfc +87 -0
- data/tracks/coldfusion/exercises/raindrops/Solution.cfc +33 -0
- data/tracks/coldfusion/exercises/raindrops/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/raindrops/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/raindrops/box.json +8 -0
- data/tracks/coldfusion/exercises/raindrops/index.cfm +37 -0
- data/tracks/coldfusion/exercises/rna-transcription/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/rna-transcription/RnaTranscription.cfc +13 -0
- data/tracks/coldfusion/exercises/rna-transcription/RnaTranscriptionTest.cfc +47 -0
- data/tracks/coldfusion/exercises/rna-transcription/Solution.cfc +35 -0
- data/tracks/coldfusion/exercises/rna-transcription/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/rna-transcription/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/rna-transcription/box.json +8 -0
- data/tracks/coldfusion/exercises/rna-transcription/index.cfm +37 -0
- data/tracks/coldfusion/exercises/saddle-points/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/saddle-points/SaddlePoints.cfc +13 -0
- data/tracks/coldfusion/exercises/saddle-points/SaddlePointsTest.cfc +35 -0
- data/tracks/coldfusion/exercises/saddle-points/Solution.cfc +59 -0
- data/tracks/coldfusion/exercises/saddle-points/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/saddle-points/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/saddle-points/box.json +8 -0
- data/tracks/coldfusion/exercises/saddle-points/index.cfm +37 -0
- data/tracks/coldfusion/exercises/scrabble-score/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/scrabble-score/ScrabbleScore.cfc +13 -0
- data/tracks/coldfusion/exercises/scrabble-score/ScrabbleScoreTest.cfc +59 -0
- data/tracks/coldfusion/exercises/scrabble-score/Solution.cfc +50 -0
- data/tracks/coldfusion/exercises/scrabble-score/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/scrabble-score/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/scrabble-score/box.json +8 -0
- data/tracks/coldfusion/exercises/scrabble-score/index.cfm +37 -0
- data/tracks/coldfusion/exercises/secret-handshake/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/secret-handshake/SecretHandshake.cfc +13 -0
- data/tracks/coldfusion/exercises/secret-handshake/SecretHandshakeTest.cfc +63 -0
- data/tracks/coldfusion/exercises/secret-handshake/Solution.cfc +31 -0
- data/tracks/coldfusion/exercises/secret-handshake/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/secret-handshake/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/secret-handshake/box.json +8 -0
- data/tracks/coldfusion/exercises/secret-handshake/index.cfm +37 -0
- data/tracks/coldfusion/exercises/space-age/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/space-age/Solution.cfc +28 -0
- data/tracks/coldfusion/exercises/space-age/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/space-age/SpaceAge.cfc +13 -0
- data/tracks/coldfusion/exercises/space-age/SpaceAgeTest.cfc +47 -0
- data/tracks/coldfusion/exercises/space-age/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/space-age/box.json +8 -0
- data/tracks/coldfusion/exercises/space-age/index.cfm +37 -0
- data/tracks/coldfusion/exercises/sum-of-multiples/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/sum-of-multiples/Solution.cfc +27 -0
- data/tracks/coldfusion/exercises/sum-of-multiples/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/sum-of-multiples/SumOfMultiples.cfc +13 -0
- data/tracks/coldfusion/exercises/sum-of-multiples/SumOfMultiplesTest.cfc +63 -0
- data/tracks/coldfusion/exercises/sum-of-multiples/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/sum-of-multiples/box.json +8 -0
- data/tracks/coldfusion/exercises/sum-of-multiples/index.cfm +37 -0
- data/tracks/coldfusion/exercises/triangle/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/exercises/triangle/Solution.cfc +53 -0
- data/tracks/coldfusion/exercises/triangle/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/exercises/triangle/TestRunner.cfc +103 -0
- data/tracks/coldfusion/exercises/triangle/Triangle.cfc +18 -0
- data/tracks/coldfusion/exercises/triangle/TriangleTest.cfc +95 -0
- data/tracks/coldfusion/exercises/triangle/box.json +8 -0
- data/tracks/coldfusion/exercises/triangle/index.cfm +37 -0
- data/tracks/coldfusion/tasks/GenerateTests.cfc +179 -0
- data/tracks/coldfusion/tasks/ScaffoldExercise.cfc +85 -0
- data/tracks/coldfusion/tasks/TestAllSolutions.cfc +24 -0
- data/tracks/coldfusion/tasks/exercise_template/.meta/HINTS.md +0 -0
- data/tracks/coldfusion/tasks/exercise_template/@@name@@.cfc +13 -0
- data/tracks/coldfusion/tasks/exercise_template/@@name@@Test.cfc +15 -0
- data/tracks/coldfusion/tasks/exercise_template/Solution.cfc +6 -0
- data/tracks/coldfusion/tasks/exercise_template/SolutionTest.cfc +7 -0
- data/tracks/coldfusion/tasks/exercise_template/TestRunner.cfc +103 -0
- data/tracks/coldfusion/tasks/exercise_template/box.json +8 -0
- data/tracks/coldfusion/tasks/exercise_template/index.cfm +37 -0
- data/tracks/common-lisp/config.json +12 -0
- data/tracks/common-lisp/exercises/collatz-conjecture/README.md +84 -0
- data/tracks/common-lisp/exercises/collatz-conjecture/collatz-conjecture-test.lisp +31 -0
- data/tracks/common-lisp/exercises/collatz-conjecture/collatz-conjecture.lisp +7 -0
- data/tracks/common-lisp/exercises/collatz-conjecture/example.lisp +14 -0
- data/tracks/csharp/exercises/clock/Clock.cs +20 -4
- data/tracks/csharp/exercises/clock/ClockTest.cs +290 -55
- data/tracks/csharp/exercises/clock/Example.cs +11 -8
- data/tracks/csharp/generators/Exercises/Clock.cs +75 -0
- data/tracks/csharp/generators/Output/FormattingExtensions.cs +0 -1
- data/tracks/csharp/generators/Program.cs +2 -1
- data/tracks/haskell/config.json +10 -0
- data/tracks/haskell/exercises/collatz-conjecture/README.md +87 -0
- data/tracks/haskell/exercises/collatz-conjecture/examples/success-standard/package.yaml +16 -0
- data/tracks/haskell/exercises/collatz-conjecture/examples/success-standard/src/CollatzConjecture.hs +9 -0
- data/tracks/haskell/exercises/collatz-conjecture/package.yaml +20 -0
- data/tracks/haskell/exercises/collatz-conjecture/src/CollatzConjecture.hs +4 -0
- data/tracks/haskell/exercises/collatz-conjecture/stack.yaml +1 -0
- data/tracks/haskell/exercises/collatz-conjecture/test/Tests.hs +52 -0
- data/tracks/idris/docs/SNIPPET.txt +10 -0
- data/tracks/rust/README.md +83 -2
- data/tracks/rust/config.json +24 -0
- data/tracks/rust/exercises/perfect-numbers/.gitignore +7 -0
- data/tracks/rust/exercises/perfect-numbers/Cargo.toml +5 -0
- data/tracks/rust/exercises/perfect-numbers/README.md +56 -0
- data/tracks/rust/exercises/perfect-numbers/example.rs +20 -0
- data/tracks/rust/exercises/perfect-numbers/src/lib.rs +0 -0
- data/tracks/rust/exercises/perfect-numbers/tests/perfect-numbers.rs +33 -0
- data/tracks/rust/exercises/poker/.gitignore +7 -0
- data/tracks/rust/exercises/poker/.meta/hints.md +8 -0
- data/tracks/rust/exercises/poker/Cargo-example.toml +8 -0
- data/tracks/rust/exercises/poker/Cargo.toml +6 -0
- data/tracks/rust/exercises/poker/README.md +54 -0
- data/tracks/rust/exercises/poker/example.rs +341 -0
- data/tracks/rust/exercises/poker/src/lib.rs +7 -0
- data/tracks/rust/exercises/poker/tests/poker.rs +298 -0
- metadata +242 -5
- data/tracks/coldfusion/exercises/leap/example.cfc +0 -11
- data/tracks/coldfusion/exercises/leap/leap.cfc +0 -5
- data/tracks/coldfusion/exercises/leap/leap_tests.cfc +0 -35
@@ -0,0 +1,14 @@
|
|
1
|
+
(defpackage #:collatz-conjecture
|
2
|
+
(:use #:common-lisp)
|
3
|
+
(:export #:collatz))
|
4
|
+
|
5
|
+
(in-package #:collatz-conjecture)
|
6
|
+
|
7
|
+
(defun collatz-helper (a n)
|
8
|
+
(cond ((= n 1) a)
|
9
|
+
((evenp n) (collatz-helper (+ 1 a) (floor n 2)))
|
10
|
+
(T (collatz-helper (+ 1 a) (+ 1 (* 3 n))))))
|
11
|
+
|
12
|
+
(defun collatz (n)
|
13
|
+
(when (> n 0)
|
14
|
+
(collatz-helper 0 n)))
|
@@ -1,15 +1,26 @@
|
|
1
1
|
using System;
|
2
2
|
|
3
|
-
public
|
3
|
+
public struct Clock
|
4
4
|
{
|
5
|
-
public Clock(int hours)
|
5
|
+
public Clock(int hours, int minutes)
|
6
6
|
{
|
7
7
|
throw new NotImplementedException("You need to implement this function.");
|
8
8
|
}
|
9
9
|
|
10
|
-
public
|
10
|
+
public int Hours
|
11
11
|
{
|
12
|
-
|
12
|
+
get
|
13
|
+
{
|
14
|
+
throw new NotImplementedException("You need to implement this function.");
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
public int Minutes
|
19
|
+
{
|
20
|
+
get
|
21
|
+
{
|
22
|
+
throw new NotImplementedException("You need to implement this function.");
|
23
|
+
}
|
13
24
|
}
|
14
25
|
|
15
26
|
public Clock Add(int minutesToAdd)
|
@@ -21,4 +32,9 @@ public Clock Subtract(int minutesToSubtract)
|
|
21
32
|
{
|
22
33
|
throw new NotImplementedException("You need to implement this function.");
|
23
34
|
}
|
35
|
+
|
36
|
+
public override string ToString()
|
37
|
+
{
|
38
|
+
throw new NotImplementedException("You need to implement this function.");
|
39
|
+
}
|
24
40
|
}
|
@@ -1,121 +1,356 @@
|
|
1
|
+
// This file was auto-generated based on version 1.0.1 of the canonical data.
|
2
|
+
|
1
3
|
using Xunit;
|
2
4
|
|
3
5
|
public class ClockTest
|
4
6
|
{
|
5
|
-
[
|
6
|
-
|
7
|
-
[InlineData(9, "09:00")]
|
8
|
-
public void Prints_the_hour(int hours, string expected)
|
7
|
+
[Fact]
|
8
|
+
public void On_the_hour()
|
9
9
|
{
|
10
|
-
|
10
|
+
var sut = new Clock(8, 0);
|
11
|
+
Assert.Equal("08:00", sut.ToString());
|
11
12
|
}
|
12
13
|
|
13
|
-
[
|
14
|
-
|
15
|
-
[InlineData(11, 19, "11:19")]
|
16
|
-
public void Prints_past_the_hour(int hours, int minutes, string expected)
|
14
|
+
[Fact(Skip = "Remove to run test")]
|
15
|
+
public void Past_the_hour()
|
17
16
|
{
|
18
|
-
|
17
|
+
var sut = new Clock(11, 9);
|
18
|
+
Assert.Equal("11:09", sut.ToString());
|
19
19
|
}
|
20
20
|
|
21
21
|
[Fact(Skip = "Remove to run test")]
|
22
|
-
public void
|
22
|
+
public void Midnight_is_zero_hours()
|
23
23
|
{
|
24
|
-
var
|
25
|
-
Assert.Equal("
|
24
|
+
var sut = new Clock(24, 0);
|
25
|
+
Assert.Equal("00:00", sut.ToString());
|
26
26
|
}
|
27
27
|
|
28
28
|
[Fact(Skip = "Remove to run test")]
|
29
|
-
public void
|
29
|
+
public void Hour_rolls_over()
|
30
30
|
{
|
31
|
-
var
|
32
|
-
Assert.Equal("
|
31
|
+
var sut = new Clock(25, 0);
|
32
|
+
Assert.Equal("01:00", sut.ToString());
|
33
33
|
}
|
34
34
|
|
35
35
|
[Fact(Skip = "Remove to run test")]
|
36
|
-
public void
|
36
|
+
public void Hour_rolls_over_continuously()
|
37
37
|
{
|
38
|
-
var
|
39
|
-
Assert.Equal("
|
38
|
+
var sut = new Clock(100, 0);
|
39
|
+
Assert.Equal("04:00", sut.ToString());
|
40
40
|
}
|
41
41
|
|
42
42
|
[Fact(Skip = "Remove to run test")]
|
43
|
-
public void
|
43
|
+
public void Sixty_minutes_is_next_hour()
|
44
44
|
{
|
45
|
-
var
|
46
|
-
Assert.Equal("
|
45
|
+
var sut = new Clock(1, 60);
|
46
|
+
Assert.Equal("02:00", sut.ToString());
|
47
47
|
}
|
48
48
|
|
49
49
|
[Fact(Skip = "Remove to run test")]
|
50
|
-
public void
|
50
|
+
public void Minutes_roll_over()
|
51
51
|
{
|
52
|
-
var
|
53
|
-
Assert.Equal("
|
52
|
+
var sut = new Clock(0, 160);
|
53
|
+
Assert.Equal("02:40", sut.ToString());
|
54
54
|
}
|
55
55
|
|
56
56
|
[Fact(Skip = "Remove to run test")]
|
57
|
-
public void
|
57
|
+
public void Minutes_roll_over_continuously()
|
58
58
|
{
|
59
|
-
var
|
60
|
-
Assert.Equal("
|
59
|
+
var sut = new Clock(0, 1723);
|
60
|
+
Assert.Equal("04:43", sut.ToString());
|
61
61
|
}
|
62
62
|
|
63
63
|
[Fact(Skip = "Remove to run test")]
|
64
|
-
public void
|
64
|
+
public void Hour_and_minutes_roll_over()
|
65
65
|
{
|
66
|
-
var
|
67
|
-
Assert.Equal("
|
66
|
+
var sut = new Clock(25, 160);
|
67
|
+
Assert.Equal("03:40", sut.ToString());
|
68
68
|
}
|
69
69
|
|
70
70
|
[Fact(Skip = "Remove to run test")]
|
71
|
-
public void
|
71
|
+
public void Hour_and_minutes_roll_over_continuously()
|
72
72
|
{
|
73
|
-
var
|
74
|
-
Assert.Equal("
|
73
|
+
var sut = new Clock(201, 3001);
|
74
|
+
Assert.Equal("11:01", sut.ToString());
|
75
75
|
}
|
76
76
|
|
77
77
|
[Fact(Skip = "Remove to run test")]
|
78
|
-
public void
|
78
|
+
public void Hour_and_minutes_roll_over_to_exactly_midnight()
|
79
79
|
{
|
80
|
-
var
|
81
|
-
Assert.Equal("00:00",
|
80
|
+
var sut = new Clock(72, 8640);
|
81
|
+
Assert.Equal("00:00", sut.ToString());
|
82
82
|
}
|
83
83
|
|
84
84
|
[Fact(Skip = "Remove to run test")]
|
85
|
-
public void
|
85
|
+
public void Negative_hour()
|
86
|
+
{
|
87
|
+
var sut = new Clock(-1, 15);
|
88
|
+
Assert.Equal("23:15", sut.ToString());
|
89
|
+
}
|
90
|
+
|
91
|
+
[Fact(Skip = "Remove to run test")]
|
92
|
+
public void Negative_hour_rolls_over()
|
93
|
+
{
|
94
|
+
var sut = new Clock(-25, 0);
|
95
|
+
Assert.Equal("23:00", sut.ToString());
|
96
|
+
}
|
97
|
+
|
98
|
+
[Fact(Skip = "Remove to run test")]
|
99
|
+
public void Negative_hour_rolls_over_continuously()
|
100
|
+
{
|
101
|
+
var sut = new Clock(-91, 0);
|
102
|
+
Assert.Equal("05:00", sut.ToString());
|
103
|
+
}
|
104
|
+
|
105
|
+
[Fact(Skip = "Remove to run test")]
|
106
|
+
public void Negative_minutes()
|
107
|
+
{
|
108
|
+
var sut = new Clock(1, -40);
|
109
|
+
Assert.Equal("00:20", sut.ToString());
|
110
|
+
}
|
111
|
+
|
112
|
+
[Fact(Skip = "Remove to run test")]
|
113
|
+
public void Negative_minutes_roll_over()
|
114
|
+
{
|
115
|
+
var sut = new Clock(1, -160);
|
116
|
+
Assert.Equal("22:20", sut.ToString());
|
117
|
+
}
|
118
|
+
|
119
|
+
[Fact(Skip = "Remove to run test")]
|
120
|
+
public void Negative_minutes_roll_over_continuously()
|
121
|
+
{
|
122
|
+
var sut = new Clock(1, -4820);
|
123
|
+
Assert.Equal("16:40", sut.ToString());
|
124
|
+
}
|
125
|
+
|
126
|
+
[Fact(Skip = "Remove to run test")]
|
127
|
+
public void Negative_hour_and_minutes_both_roll_over()
|
128
|
+
{
|
129
|
+
var sut = new Clock(-25, -160);
|
130
|
+
Assert.Equal("20:20", sut.ToString());
|
131
|
+
}
|
132
|
+
|
133
|
+
[Fact(Skip = "Remove to run test")]
|
134
|
+
public void Negative_hour_and_minutes_both_roll_over_continuously()
|
135
|
+
{
|
136
|
+
var sut = new Clock(-121, -5810);
|
137
|
+
Assert.Equal("22:10", sut.ToString());
|
138
|
+
}
|
139
|
+
|
140
|
+
[Fact(Skip = "Remove to run test")]
|
141
|
+
public void Add_minutes()
|
142
|
+
{
|
143
|
+
var sut = new Clock(10, 0);
|
144
|
+
Assert.Equal("10:03", sut.Add(3).ToString());
|
145
|
+
}
|
146
|
+
|
147
|
+
[Fact(Skip = "Remove to run test")]
|
148
|
+
public void Add_no_minutes()
|
149
|
+
{
|
150
|
+
var sut = new Clock(6, 41);
|
151
|
+
Assert.Equal("06:41", sut.Add(0).ToString());
|
152
|
+
}
|
153
|
+
|
154
|
+
[Fact(Skip = "Remove to run test")]
|
155
|
+
public void Add_to_next_hour()
|
156
|
+
{
|
157
|
+
var sut = new Clock(0, 45);
|
158
|
+
Assert.Equal("01:25", sut.Add(40).ToString());
|
159
|
+
}
|
160
|
+
|
161
|
+
[Fact(Skip = "Remove to run test")]
|
162
|
+
public void Add_more_than_one_hour()
|
163
|
+
{
|
164
|
+
var sut = new Clock(10, 0);
|
165
|
+
Assert.Equal("11:01", sut.Add(61).ToString());
|
166
|
+
}
|
167
|
+
|
168
|
+
[Fact(Skip = "Remove to run test")]
|
169
|
+
public void Add_more_than_two_hours_with_carry()
|
170
|
+
{
|
171
|
+
var sut = new Clock(0, 45);
|
172
|
+
Assert.Equal("03:25", sut.Add(160).ToString());
|
173
|
+
}
|
174
|
+
|
175
|
+
[Fact(Skip = "Remove to run test")]
|
176
|
+
public void Add_across_midnight()
|
177
|
+
{
|
178
|
+
var sut = new Clock(23, 59);
|
179
|
+
Assert.Equal("00:01", sut.Add(2).ToString());
|
180
|
+
}
|
181
|
+
|
182
|
+
[Fact(Skip = "Remove to run test")]
|
183
|
+
public void Add_more_than_one_day_1500_min_25_hrs_()
|
184
|
+
{
|
185
|
+
var sut = new Clock(5, 32);
|
186
|
+
Assert.Equal("06:32", sut.Add(1500).ToString());
|
187
|
+
}
|
188
|
+
|
189
|
+
[Fact(Skip = "Remove to run test")]
|
190
|
+
public void Add_more_than_two_days()
|
191
|
+
{
|
192
|
+
var sut = new Clock(1, 1);
|
193
|
+
Assert.Equal("11:21", sut.Add(3500).ToString());
|
194
|
+
}
|
195
|
+
|
196
|
+
[Fact(Skip = "Remove to run test")]
|
197
|
+
public void Subtract_minutes()
|
198
|
+
{
|
199
|
+
var sut = new Clock(10, 3);
|
200
|
+
Assert.Equal("10:00", sut.Add(-3).ToString());
|
201
|
+
}
|
202
|
+
|
203
|
+
[Fact(Skip = "Remove to run test")]
|
204
|
+
public void Subtract_to_previous_hour()
|
205
|
+
{
|
206
|
+
var sut = new Clock(10, 3);
|
207
|
+
Assert.Equal("09:33", sut.Add(-30).ToString());
|
208
|
+
}
|
209
|
+
|
210
|
+
[Fact(Skip = "Remove to run test")]
|
211
|
+
public void Subtract_more_than_an_hour()
|
212
|
+
{
|
213
|
+
var sut = new Clock(10, 3);
|
214
|
+
Assert.Equal("08:53", sut.Add(-70).ToString());
|
215
|
+
}
|
216
|
+
|
217
|
+
[Fact(Skip = "Remove to run test")]
|
218
|
+
public void Subtract_across_midnight()
|
219
|
+
{
|
220
|
+
var sut = new Clock(0, 3);
|
221
|
+
Assert.Equal("23:59", sut.Add(-4).ToString());
|
222
|
+
}
|
223
|
+
|
224
|
+
[Fact(Skip = "Remove to run test")]
|
225
|
+
public void Subtract_more_than_two_hours()
|
226
|
+
{
|
227
|
+
var sut = new Clock(0, 0);
|
228
|
+
Assert.Equal("21:20", sut.Add(-160).ToString());
|
229
|
+
}
|
230
|
+
|
231
|
+
[Fact(Skip = "Remove to run test")]
|
232
|
+
public void Subtract_more_than_two_hours_with_borrow()
|
233
|
+
{
|
234
|
+
var sut = new Clock(6, 15);
|
235
|
+
Assert.Equal("03:35", sut.Add(-160).ToString());
|
236
|
+
}
|
237
|
+
|
238
|
+
[Fact(Skip = "Remove to run test")]
|
239
|
+
public void Subtract_more_than_one_day_1500_min_25_hrs_()
|
240
|
+
{
|
241
|
+
var sut = new Clock(5, 32);
|
242
|
+
Assert.Equal("04:32", sut.Add(-1500).ToString());
|
243
|
+
}
|
244
|
+
|
245
|
+
[Fact(Skip = "Remove to run test")]
|
246
|
+
public void Subtract_more_than_two_days()
|
247
|
+
{
|
248
|
+
var sut = new Clock(2, 20);
|
249
|
+
Assert.Equal("00:20", sut.Add(-3000).ToString());
|
250
|
+
}
|
251
|
+
|
252
|
+
[Fact(Skip = "Remove to run test")]
|
253
|
+
public void Clocks_with_same_time()
|
254
|
+
{
|
255
|
+
var sut = new Clock(15, 37);
|
256
|
+
Assert.True(sut.Equals(new Clock(15, 37)));
|
257
|
+
}
|
258
|
+
|
259
|
+
[Fact(Skip = "Remove to run test")]
|
260
|
+
public void Clocks_a_minute_apart()
|
261
|
+
{
|
262
|
+
var sut = new Clock(15, 36);
|
263
|
+
Assert.False(sut.Equals(new Clock(15, 37)));
|
264
|
+
}
|
265
|
+
|
266
|
+
[Fact(Skip = "Remove to run test")]
|
267
|
+
public void Clocks_an_hour_apart()
|
268
|
+
{
|
269
|
+
var sut = new Clock(14, 37);
|
270
|
+
Assert.False(sut.Equals(new Clock(15, 37)));
|
271
|
+
}
|
272
|
+
|
273
|
+
[Fact(Skip = "Remove to run test")]
|
274
|
+
public void Clocks_with_hour_overflow()
|
275
|
+
{
|
276
|
+
var sut = new Clock(10, 37);
|
277
|
+
Assert.True(sut.Equals(new Clock(34, 37)));
|
278
|
+
}
|
279
|
+
|
280
|
+
[Fact(Skip = "Remove to run test")]
|
281
|
+
public void Clocks_with_hour_overflow_by_several_days()
|
282
|
+
{
|
283
|
+
var sut = new Clock(3, 11);
|
284
|
+
Assert.True(sut.Equals(new Clock(99, 11)));
|
285
|
+
}
|
286
|
+
|
287
|
+
[Fact(Skip = "Remove to run test")]
|
288
|
+
public void Clocks_with_negative_hour()
|
289
|
+
{
|
290
|
+
var sut = new Clock(22, 40);
|
291
|
+
Assert.True(sut.Equals(new Clock(-2, 40)));
|
292
|
+
}
|
293
|
+
|
294
|
+
[Fact(Skip = "Remove to run test")]
|
295
|
+
public void Clocks_with_negative_hour_that_wraps()
|
296
|
+
{
|
297
|
+
var sut = new Clock(17, 3);
|
298
|
+
Assert.True(sut.Equals(new Clock(-31, 3)));
|
299
|
+
}
|
300
|
+
|
301
|
+
[Fact(Skip = "Remove to run test")]
|
302
|
+
public void Clocks_with_negative_hour_that_wraps_multiple_times()
|
303
|
+
{
|
304
|
+
var sut = new Clock(13, 49);
|
305
|
+
Assert.True(sut.Equals(new Clock(-83, 49)));
|
306
|
+
}
|
307
|
+
|
308
|
+
[Fact(Skip = "Remove to run test")]
|
309
|
+
public void Clocks_with_minute_overflow()
|
310
|
+
{
|
311
|
+
var sut = new Clock(0, 1);
|
312
|
+
Assert.True(sut.Equals(new Clock(0, 1441)));
|
313
|
+
}
|
314
|
+
|
315
|
+
[Fact(Skip = "Remove to run test")]
|
316
|
+
public void Clocks_with_minute_overflow_by_several_days()
|
317
|
+
{
|
318
|
+
var sut = new Clock(2, 2);
|
319
|
+
Assert.True(sut.Equals(new Clock(2, 4322)));
|
320
|
+
}
|
321
|
+
|
322
|
+
[Fact(Skip = "Remove to run test")]
|
323
|
+
public void Clocks_with_negative_minute()
|
86
324
|
{
|
87
|
-
var
|
88
|
-
Assert.
|
325
|
+
var sut = new Clock(2, 40);
|
326
|
+
Assert.True(sut.Equals(new Clock(3, -20)));
|
89
327
|
}
|
90
328
|
|
91
329
|
[Fact(Skip = "Remove to run test")]
|
92
|
-
public void
|
330
|
+
public void Clocks_with_negative_minute_that_wraps()
|
93
331
|
{
|
94
|
-
var
|
95
|
-
|
96
|
-
Assert.Equal(clock2, clock1);
|
332
|
+
var sut = new Clock(4, 10);
|
333
|
+
Assert.True(sut.Equals(new Clock(5, -1490)));
|
97
334
|
}
|
98
335
|
|
99
336
|
[Fact(Skip = "Remove to run test")]
|
100
|
-
public void
|
337
|
+
public void Clocks_with_negative_minute_that_wraps_multiple_times()
|
101
338
|
{
|
102
|
-
var
|
103
|
-
|
104
|
-
Assert.NotEqual(clock2, clock1);
|
339
|
+
var sut = new Clock(6, 15);
|
340
|
+
Assert.True(sut.Equals(new Clock(6, -4305)));
|
105
341
|
}
|
106
342
|
|
107
343
|
[Fact(Skip = "Remove to run test")]
|
108
|
-
public void
|
344
|
+
public void Clocks_with_negative_hours_and_minutes()
|
109
345
|
{
|
110
|
-
var
|
111
|
-
|
112
|
-
Assert.Equal(clock2, clock1);
|
346
|
+
var sut = new Clock(7, 32);
|
347
|
+
Assert.True(sut.Equals(new Clock(-12, -268)));
|
113
348
|
}
|
114
349
|
|
115
350
|
[Fact(Skip = "Remove to run test")]
|
116
|
-
public void
|
351
|
+
public void Clocks_with_negative_hours_and_minutes_that_wrap()
|
117
352
|
{
|
118
|
-
var
|
119
|
-
Assert.
|
353
|
+
var sut = new Clock(18, 7);
|
354
|
+
Assert.True(sut.Equals(new Clock(-54, -11513)));
|
120
355
|
}
|
121
356
|
}
|