trackler 2.0.6.12 → 2.0.6.13
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/tracks/c/docs/ABOUT.md +5 -0
- data/tracks/c/docs/INSTALLATION.md +5 -6
- data/tracks/c/docs/LEARNING.md +34 -0
- data/tracks/c/docs/RESOURCES.md +3 -0
- data/tracks/csharp/config.json +9 -0
- data/tracks/csharp/exercises/pov/Example.cs +125 -0
- data/tracks/csharp/exercises/pov/PovTest.cs +160 -0
- data/tracks/csharp/exercises/sum-of-multiples/SumOfMultiplesTest.cs +12 -6
- data/tracks/go/exercises/meetup/cases_test.go +0 -0
- data/tracks/go/exercises/raindrops/cases_test.go +0 -0
- data/tracks/go/exercises/rna-transcription/cases_test.go +0 -0
- data/tracks/go/exercises/roman-numerals/cases_test.go +0 -0
- data/tracks/go/exercises/word-count/cases_test.go +0 -0
- data/tracks/go/gen/gen.go +1 -1
- data/tracks/java/docs/MAINTAINING.md +11 -6
- data/tracks/java/exercises/meetup/src/test/java/MeetupTest.java +91 -91
- data/tracks/java/exercises/settings.gradle +1 -0
- data/tracks/kotlin/config.json +2 -1
- data/tracks/kotlin/exercises/_template/build.gradle +1 -1
- data/tracks/kotlin/exercises/accumulate/build.gradle +1 -1
- data/tracks/kotlin/exercises/acronym/build.gradle +1 -1
- data/tracks/kotlin/exercises/allergies/build.gradle +1 -1
- data/tracks/kotlin/exercises/anagram/build.gradle +1 -1
- data/tracks/kotlin/exercises/atbash-cipher/build.gradle +1 -1
- data/tracks/kotlin/exercises/beer-song/build.gradle +1 -1
- data/tracks/kotlin/exercises/binary-search/build.gradle +1 -1
- data/tracks/kotlin/exercises/binary/build.gradle +1 -1
- data/tracks/kotlin/exercises/bob/build.gradle +1 -1
- data/tracks/kotlin/exercises/bracket-push/build.gradle +1 -1
- data/tracks/kotlin/exercises/change/build.gradle +1 -1
- data/tracks/kotlin/exercises/difference-of-squares/build.gradle +1 -1
- data/tracks/kotlin/exercises/etl/build.gradle +1 -1
- data/tracks/kotlin/exercises/flatten-array/build.gradle +1 -1
- data/tracks/kotlin/exercises/gigasecond/build.gradle +1 -1
- data/tracks/kotlin/exercises/grade-school/build.gradle +1 -1
- data/tracks/kotlin/exercises/hamming/build.gradle +1 -1
- data/tracks/kotlin/exercises/hello-world/build.gradle +1 -1
- data/tracks/kotlin/exercises/hexadecimal/build.gradle +1 -1
- data/tracks/kotlin/exercises/isogram/build.gradle +1 -1
- data/tracks/kotlin/exercises/largest-series-product/build.gradle +1 -1
- data/tracks/kotlin/exercises/leap/build.gradle +1 -1
- data/tracks/kotlin/exercises/linked-list/build.gradle +1 -1
- data/tracks/kotlin/exercises/luhn/build.gradle +1 -1
- data/tracks/kotlin/exercises/nth-prime/build.gradle +1 -1
- data/tracks/kotlin/exercises/nucleotide-count/build.gradle +1 -1
- data/tracks/kotlin/exercises/pangram/build.gradle +1 -1
- data/tracks/kotlin/exercises/pascals-triangle/build.gradle +1 -1
- data/tracks/kotlin/exercises/phone-number/build.gradle +1 -1
- data/tracks/kotlin/exercises/pig-latin/build.gradle +1 -1
- data/tracks/kotlin/exercises/raindrops/build.gradle +1 -1
- data/tracks/kotlin/exercises/rna-transcription/build.gradle +1 -1
- data/tracks/kotlin/exercises/rna-transcription/src/example/kotlin/RnaTranscription.kt +9 -12
- data/tracks/kotlin/exercises/rna-transcription/src/main/kotlin/RnaTranscription.kt +9 -0
- data/tracks/kotlin/exercises/rna-transcription/src/test/kotlin/RnaTranscriptionTest.kt +6 -6
- data/tracks/kotlin/exercises/robot-name/build.gradle +1 -1
- data/tracks/kotlin/exercises/roman-numerals/build.gradle +1 -1
- data/tracks/kotlin/exercises/scrabble-score/build.gradle +1 -1
- data/tracks/kotlin/exercises/series/build.gradle +1 -1
- data/tracks/kotlin/exercises/sieve/build.gradle +1 -1
- data/tracks/kotlin/exercises/simple-cipher/build.gradle +1 -1
- data/tracks/kotlin/exercises/space-age/build.gradle +1 -1
- data/tracks/kotlin/exercises/strain/build.gradle +1 -1
- data/tracks/kotlin/exercises/word-count/build.gradle +1 -1
- data/tracks/lua/exercises/circular-buffer/circular-buffer_spec.lua +1 -1
- data/tracks/pascal/docs/INSTALLATION.md +7 -5
- data/tracks/pascal/docs/TESTS.md +4 -0
- data/tracks/php/config.json +9 -0
- data/tracks/php/exercises/ocr-numbers/example.php +113 -0
- data/tracks/php/exercises/ocr-numbers/ocr-numbers_test.php +222 -0
- metadata +10 -3
- data/tracks/kotlin/exercises/rna-transcription/src/main/kotlin/.keep +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 908196b422992f0a5116328c5efcd82340322c89
|
4
|
+
data.tar.gz: 88112e4cf238d4590f497bbba04f9cf21087f873
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10fb6193269541b0dce8c9f4cd44749a83e06a251cae0a5fcae35b8edc3122aeda761754f08addc071c627c65cb0560c531254737a49b0a81dd24a523e20e1b6
|
7
|
+
data.tar.gz: 1d5ac6a45f0c7d9bd0c11ebf5f6abbb327b39481f3fad8195ed4bf9dafa13f6d6ef86cdd9bcad93c9330acbe4347fb28013fac11840f88df11fd93e90708270a
|
data/lib/trackler/version.rb
CHANGED
@@ -0,0 +1,5 @@
|
|
1
|
+
C is a general-purpose, imperative computer programming language, supporting structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations. By design, C provides constructs that map efficiently to typical machine instructions, and therefore it has found lasting use in applications that had formerly been coded in assembly language, including operating systems, as well as various application software for computers ranging from supercomputers to embedded systems.
|
2
|
+
|
3
|
+
C was originally developed by Dennis Ritchie between 1969 and 1973 at Bell Labs, and used to re-implement the Unix operating system. It has since become one of the most widely used programming languages of all time, with C compilers from various vendors available for the majority of existing computer architectures and operating systems. C has been standardized by the American National Standards Institute (ANSI) since 1989 (see ANSI C) and subsequently by the International Organization for Standardization (ISO).
|
4
|
+
|
5
|
+
Taken from https://en.wikipedia.org/wiki/C_(programming_language)
|
@@ -15,21 +15,20 @@ build system as separate command-line tools.
|
|
15
15
|
Linux users will need gcc or clang for the compiler, and `make` will be needed
|
16
16
|
for the native build. Make is pre-installed on most unix systems, but is most
|
17
17
|
likely available via your package manager. On Debian and Ubuntu based
|
18
|
-
distributions
|
19
|
-
present.
|
18
|
+
distributions everything you need can be installed with `sudo apt-get install build-essential`
|
19
|
+
if not present.
|
20
20
|
|
21
21
|
|
22
22
|
#### MacOS
|
23
23
|
|
24
|
-
MacOS users can install gcc or
|
24
|
+
MacOS users can install gcc or clang with [Homebrew](http://brew.sh/) via
|
25
25
|
`brew install gcc` or `brew install llvm`.
|
26
26
|
|
27
27
|
|
28
28
|
#### Windows
|
29
29
|
|
30
|
-
Windows users can get [Visual Studio Community
|
30
|
+
Windows users can get [Visual Studio Community][vs], a free download
|
31
31
|
that will give you the Visual Studio 2013 IDE and the latest version of the
|
32
32
|
Microsoft Visual C compiler.
|
33
33
|
|
34
|
-
[vs
|
35
|
-
|
34
|
+
[vs]: http://visualstudio.com
|
@@ -0,0 +1,34 @@
|
|
1
|
+
## Learning C From Ground Zero
|
2
|
+
|
3
|
+
In general, exercism assumes you already know the syntax and mechanisms
|
4
|
+
of a language in a particular track. However, knowing the syntax of a
|
5
|
+
language is merely the first step in gaining expertise in a language.
|
6
|
+
Exercism allows you to practice solving problems and share discussion
|
7
|
+
with other programmers who have solved the same problem. It is from
|
8
|
+
the shared discussion that we gain expertise and insight into becoming
|
9
|
+
better programmers.
|
10
|
+
|
11
|
+
If you are brand new to the C language, you should spend time learning
|
12
|
+
the basics of the language first. Here are a few resources that can
|
13
|
+
help you get started:
|
14
|
+
|
15
|
+
* [Learn C](http://www.learn-c.org/)
|
16
|
+
* [CS50x](https://www.edx.org/course/introduction-computer-science-harvardx-cs50x)
|
17
|
+
|
18
|
+
[CodeChef](https://www.codechef.com/ide) is a simple web form
|
19
|
+
interface to a C compiler that will let you try out small programs.
|
20
|
+
Sometimes this can be an easier way to perform a quick experiment than
|
21
|
+
building something locally in an integrated development environment.
|
22
|
+
|
23
|
+
## Test-Driven Development in C
|
24
|
+
|
25
|
+
Exercism assumes that you are familiar with the concept of test-driven
|
26
|
+
development. Each exercise comes with a series of tests that are already
|
27
|
+
written for you. You progress through the exercise one test at a time,
|
28
|
+
writing an implementation incrementally to satisfy the tests.
|
29
|
+
|
30
|
+
If you are new to test-driven development, it is strongly recommended
|
31
|
+
that you first work through a [quick overview of some test frameworks for C](http://www.drdobbs.com/testing/unit-testing-in-c-tools-and-conventions/240156344?pgno=2)
|
32
|
+
or read the book [Test-Driven Development for Embedded C](https://pragprog.com/book/jgade/test-driven-development-for-embedded-c)
|
33
|
+
by James Grenning. These resources cover [Unity](http://www.throwtheswitch.org/unity/)
|
34
|
+
and [CppUTest](http://cpputest.github.io/); this track uses Unity.
|
@@ -0,0 +1,3 @@
|
|
1
|
+
- [C++ Reference](http://en.cppreference.com/w/): An online reference for C and C++ programming languages. You have a doubt what a method does? cppreference.com has you covered.
|
2
|
+
- [The Definitive C Book Guide and List](http://stackoverflow.com/questions/562303/the-definitive-c-book-guide-and-list): The legendary StackOverflow's question about C books.
|
3
|
+
- [`C` tag on StackOverflow](http://stackoverflow.com/questions/tagged/c)
|
data/tracks/csharp/config.json
CHANGED
@@ -0,0 +1,125 @@
|
|
1
|
+
using System;
|
2
|
+
using System.Collections.Generic;
|
3
|
+
using System.Linq;
|
4
|
+
|
5
|
+
public class Graph<T> : IEquatable<Graph<T>>
|
6
|
+
{
|
7
|
+
public Graph(T value, IEnumerable<Graph<T>> children)
|
8
|
+
{
|
9
|
+
Value = value;
|
10
|
+
Children = children;
|
11
|
+
}
|
12
|
+
|
13
|
+
public T Value { get; }
|
14
|
+
public IEnumerable<Graph<T>> Children { get; }
|
15
|
+
|
16
|
+
public bool Equals(Graph<T> other) =>
|
17
|
+
Value.Equals(other.Value) && Children.SequenceEqual(other.Children);
|
18
|
+
}
|
19
|
+
|
20
|
+
public class Crumb<T>
|
21
|
+
{
|
22
|
+
public Crumb(T value, IEnumerable<Graph<T>> left, IEnumerable<Graph<T>> right)
|
23
|
+
{
|
24
|
+
Value = value;
|
25
|
+
Left = left;
|
26
|
+
Right = right;
|
27
|
+
}
|
28
|
+
|
29
|
+
public T Value { get; }
|
30
|
+
public IEnumerable<Graph<T>> Left { get; }
|
31
|
+
public IEnumerable<Graph<T>> Right { get; }
|
32
|
+
}
|
33
|
+
|
34
|
+
public class Zipper<T>
|
35
|
+
{
|
36
|
+
public Zipper(Graph<T> focus, IEnumerable<Crumb<T>> crumbs)
|
37
|
+
{
|
38
|
+
Focus = focus;
|
39
|
+
Crumbs = crumbs;
|
40
|
+
}
|
41
|
+
|
42
|
+
public Graph<T> Focus { get; }
|
43
|
+
public IEnumerable<Crumb<T>> Crumbs { get; }
|
44
|
+
}
|
45
|
+
|
46
|
+
public static class Pov
|
47
|
+
{
|
48
|
+
public static Graph<T> CreateGraph<T>(T value, IEnumerable<Graph<T>> children)
|
49
|
+
=> new Graph<T>(value, children);
|
50
|
+
|
51
|
+
public static Graph<T> FromPOV<T>(T value, Graph<T> graph) where T : IComparable
|
52
|
+
=> ChangeParent(FindNode(value, GraphToZipper(graph)));
|
53
|
+
|
54
|
+
public static IEnumerable<T> TracePathBetween<T>(T value1, T value2, Graph<T> graph) where T : IComparable
|
55
|
+
=> ZipperToPath(FindNode(value2, GraphToZipper(FromPOV(value1, graph))));
|
56
|
+
|
57
|
+
private static Zipper<T> GraphToZipper<T>(Graph<T> graph)
|
58
|
+
{
|
59
|
+
if (graph == null)
|
60
|
+
return null;
|
61
|
+
|
62
|
+
return new Zipper<T>(graph, Enumerable.Empty<Crumb<T>>());
|
63
|
+
}
|
64
|
+
|
65
|
+
private static IEnumerable<T> ZipperToPath<T>(Zipper<T> zipper)
|
66
|
+
{
|
67
|
+
if (zipper == null)
|
68
|
+
return null;
|
69
|
+
|
70
|
+
return zipper.Crumbs.Select(c => c.Value).Reverse().Concat(new[] { zipper.Focus.Value });
|
71
|
+
}
|
72
|
+
|
73
|
+
private static Zipper<T> GoDown<T>(Zipper<T> zipper)
|
74
|
+
{
|
75
|
+
if (zipper == null || !zipper.Focus.Children.Any())
|
76
|
+
return null;
|
77
|
+
|
78
|
+
var focus = zipper.Focus;
|
79
|
+
var children = focus.Children;
|
80
|
+
|
81
|
+
var newCrumb = new Crumb<T>(focus.Value, Enumerable.Empty<Graph<T>>(), children.Skip(1));
|
82
|
+
|
83
|
+
return new Zipper<T>(children.First(), new[] { newCrumb }.Concat(zipper.Crumbs));
|
84
|
+
}
|
85
|
+
|
86
|
+
private static Zipper<T> GoRight<T>(Zipper<T> zipper)
|
87
|
+
{
|
88
|
+
if (zipper == null || !zipper.Crumbs.Any() || !zipper.Crumbs.First().Right.Any())
|
89
|
+
return null;
|
90
|
+
|
91
|
+
var crumbs = zipper.Crumbs;
|
92
|
+
var firstCrumb = crumbs.First();
|
93
|
+
|
94
|
+
var newCrumb = new Crumb<T>(firstCrumb.Value, firstCrumb.Left.Concat(new[] { zipper.Focus }), firstCrumb.Right.Skip(1));
|
95
|
+
|
96
|
+
return new Zipper<T>(firstCrumb.Right.First(), new[] { newCrumb }.Concat(crumbs.Skip(1)));
|
97
|
+
}
|
98
|
+
|
99
|
+
private static Zipper<T> FindNode<T>(T value, Zipper<T> zipper)
|
100
|
+
where T : IComparable
|
101
|
+
{
|
102
|
+
if (zipper == null || zipper.Focus.Value.CompareTo(value) == 0)
|
103
|
+
return zipper;
|
104
|
+
|
105
|
+
return FindNode(value, GoDown(zipper)) ?? FindNode(value, GoRight(zipper));
|
106
|
+
}
|
107
|
+
|
108
|
+
private static Graph<T> ChangeParent<T>(Zipper<T> zipper)
|
109
|
+
{
|
110
|
+
if (zipper == null)
|
111
|
+
return null;
|
112
|
+
|
113
|
+
if (!zipper.Crumbs.Any())
|
114
|
+
return zipper.Focus;
|
115
|
+
|
116
|
+
var firstCrumb = zipper.Crumbs.First();
|
117
|
+
var focus = zipper.Focus;
|
118
|
+
|
119
|
+
var newZipper = new Zipper<T>(CreateGraph(firstCrumb.Value, firstCrumb.Left.Concat(firstCrumb.Right)), zipper.Crumbs.Skip(1));
|
120
|
+
var parentGraph = ChangeParent(newZipper);
|
121
|
+
|
122
|
+
var ys = focus.Children.Concat(new[] { parentGraph });
|
123
|
+
return CreateGraph(focus.Value, ys);
|
124
|
+
}
|
125
|
+
}
|
@@ -0,0 +1,160 @@
|
|
1
|
+
using NUnit.Framework;
|
2
|
+
using System.Linq;
|
3
|
+
|
4
|
+
public class PovTest
|
5
|
+
{
|
6
|
+
private const string x = "x";
|
7
|
+
|
8
|
+
private static Graph<T> leaf<T>(T v) => Pov.CreateGraph(v, new Graph<T>[0]);
|
9
|
+
|
10
|
+
private static readonly Graph<string> singleton = Pov.CreateGraph(x, new Graph<string>[0]);
|
11
|
+
|
12
|
+
private static readonly Graph<string> flat = Pov.CreateGraph("root", new[] { "a", "b", x, "c" }.Select(leaf));
|
13
|
+
|
14
|
+
private static readonly Graph<string> nested =
|
15
|
+
Pov.CreateGraph("level-0", new[] {
|
16
|
+
Pov.CreateGraph("level-1", new[] {
|
17
|
+
Pov.CreateGraph("level-2", new[] {
|
18
|
+
Pov.CreateGraph("level-3", new[] {
|
19
|
+
Pov.CreateGraph(x, new Graph<string>[0])
|
20
|
+
})
|
21
|
+
})
|
22
|
+
})
|
23
|
+
});
|
24
|
+
|
25
|
+
private static readonly Graph<string> kids =
|
26
|
+
Pov.CreateGraph("root", new[] {
|
27
|
+
Pov.CreateGraph(x, new[] {
|
28
|
+
Pov.CreateGraph("kid-0", new Graph<string>[0]),
|
29
|
+
Pov.CreateGraph("kid-1", new Graph<string>[0])
|
30
|
+
})
|
31
|
+
});
|
32
|
+
|
33
|
+
private static readonly Graph<string> cousins =
|
34
|
+
Pov.CreateGraph("grandparent", new[] {
|
35
|
+
Pov.CreateGraph("parent", new [] {
|
36
|
+
Pov.CreateGraph(x, new [] {
|
37
|
+
leaf("kid-a"),
|
38
|
+
leaf("kid-b")
|
39
|
+
}),
|
40
|
+
leaf("sibling-0"),
|
41
|
+
leaf("sibling-1")
|
42
|
+
}),
|
43
|
+
Pov.CreateGraph("uncle", new [] {
|
44
|
+
leaf("cousin-0"),
|
45
|
+
leaf("cousin-1")
|
46
|
+
})
|
47
|
+
});
|
48
|
+
|
49
|
+
private static readonly Graph<string> singleton_ = singleton;
|
50
|
+
|
51
|
+
private static readonly Graph<string> flat_ =
|
52
|
+
Pov.CreateGraph(x, new[] {
|
53
|
+
Pov.CreateGraph("root", new [] { "a", "b", "c" }.Select(leaf))
|
54
|
+
});
|
55
|
+
|
56
|
+
private static readonly Graph<string> nested_ =
|
57
|
+
Pov.CreateGraph(x, new[] {
|
58
|
+
Pov.CreateGraph("level-3", new [] {
|
59
|
+
Pov.CreateGraph("level-2", new [] {
|
60
|
+
Pov.CreateGraph("level-1", new [] {
|
61
|
+
Pov.CreateGraph("level-0", new Graph<string>[0])
|
62
|
+
})
|
63
|
+
})
|
64
|
+
})
|
65
|
+
});
|
66
|
+
|
67
|
+
private static readonly Graph<string> kids_ =
|
68
|
+
Pov.CreateGraph(x, new[] {
|
69
|
+
Pov.CreateGraph("kid-0", new Graph<string>[0]),
|
70
|
+
Pov.CreateGraph("kid-1", new Graph<string>[0]),
|
71
|
+
Pov.CreateGraph("root", new Graph<string>[0])
|
72
|
+
});
|
73
|
+
|
74
|
+
private static readonly Graph<string> cousins_ =
|
75
|
+
Pov.CreateGraph(x, new[] {
|
76
|
+
leaf("kid-a"),
|
77
|
+
leaf("kid-b"),
|
78
|
+
Pov.CreateGraph("parent", new [] {
|
79
|
+
Pov.CreateGraph("sibling-0", new Graph<string>[0]),
|
80
|
+
Pov.CreateGraph("sibling-1", new Graph<string>[0]),
|
81
|
+
Pov.CreateGraph("grandparent", new [] {
|
82
|
+
Pov.CreateGraph("uncle", new [] {
|
83
|
+
Pov.CreateGraph("cousin-0", new Graph<string>[0]),
|
84
|
+
Pov.CreateGraph("cousin-1", new Graph<string>[0])
|
85
|
+
})
|
86
|
+
})
|
87
|
+
})
|
88
|
+
});
|
89
|
+
|
90
|
+
[Test]
|
91
|
+
public void Reparent_singleton()
|
92
|
+
{
|
93
|
+
Assert.That(Pov.FromPOV(x, singleton), Is.EqualTo(singleton_));
|
94
|
+
}
|
95
|
+
|
96
|
+
[Ignore("Remove to run test")]
|
97
|
+
[Test]
|
98
|
+
public void Reparent_flat()
|
99
|
+
{
|
100
|
+
Assert.That(Pov.FromPOV(x, flat), Is.EqualTo(flat_));
|
101
|
+
}
|
102
|
+
|
103
|
+
[Ignore("Remove to run test")]
|
104
|
+
[Test]
|
105
|
+
public void Reparent_nested()
|
106
|
+
{
|
107
|
+
Assert.That(Pov.FromPOV(x, nested), Is.EqualTo(nested_));
|
108
|
+
}
|
109
|
+
|
110
|
+
[Ignore("Remove to run test")]
|
111
|
+
[Test]
|
112
|
+
public void Reparent_kids()
|
113
|
+
{
|
114
|
+
Assert.That(Pov.FromPOV(x, kids), Is.EqualTo(kids_));
|
115
|
+
}
|
116
|
+
|
117
|
+
[Ignore("Remove to run test")]
|
118
|
+
[Test]
|
119
|
+
public void Reparent_cousins()
|
120
|
+
{
|
121
|
+
Assert.That(Pov.FromPOV(x, cousins), Is.EqualTo(cousins_));
|
122
|
+
}
|
123
|
+
|
124
|
+
[Ignore("Remove to run test")]
|
125
|
+
[Test]
|
126
|
+
public void Reparent_from_POV_of_non_existent_node()
|
127
|
+
{
|
128
|
+
Assert.That(Pov.FromPOV(x, leaf("foo")), Is.Null);
|
129
|
+
}
|
130
|
+
|
131
|
+
[Ignore("Remove to run test")]
|
132
|
+
[Test]
|
133
|
+
public void Should_not_be_able_to_find_a_missing_node()
|
134
|
+
{
|
135
|
+
var nodes = new[] { singleton, flat, kids, nested, cousins }.Select(graph => Pov.FromPOV("NOT THERE", graph));
|
136
|
+
|
137
|
+
Assert.That(nodes, Is.All.Null);
|
138
|
+
}
|
139
|
+
|
140
|
+
[Ignore("Remove to run test")]
|
141
|
+
[Test]
|
142
|
+
public void Cannot_trace_between_unconnected_nodes()
|
143
|
+
{
|
144
|
+
Assert.That(Pov.TracePathBetween(x, "NOT THERE", cousins), Is.Null);
|
145
|
+
}
|
146
|
+
|
147
|
+
[Ignore("Remove to run test")]
|
148
|
+
[Test]
|
149
|
+
public void Can_trace_a_path_from_x_to_cousin()
|
150
|
+
{
|
151
|
+
Assert.That(Pov.TracePathBetween(x, "cousin-1", cousins), Is.EquivalentTo(new[] { "x", "parent", "grandparent", "uncle", "cousin-1" }));
|
152
|
+
}
|
153
|
+
|
154
|
+
[Ignore("Remove to run test")]
|
155
|
+
[Test]
|
156
|
+
public void Can_trace_from_a_leaf_to_a_leaf()
|
157
|
+
{
|
158
|
+
Assert.That(Pov.TracePathBetween("kid-a", "cousin-0", cousins), Is.EquivalentTo(new[] { "kid-a", "x", "parent", "grandparent", "uncle", "cousin-0" }));
|
159
|
+
}
|
160
|
+
}
|
@@ -8,37 +8,43 @@ public class SumOfMultiplesTest
|
|
8
8
|
{
|
9
9
|
Assert.That(SumOfMultiples.To(new[] { 3, 5 }, 1), Is.EqualTo(0));
|
10
10
|
}
|
11
|
-
|
11
|
+
|
12
|
+
[Ignore("Remove to run test")]
|
12
13
|
[Test]
|
13
14
|
public void Sum_to_3()
|
14
15
|
{
|
15
16
|
Assert.That(SumOfMultiples.To(new[] { 3, 5 }, 4), Is.EqualTo(3));
|
16
17
|
}
|
17
|
-
|
18
|
+
|
19
|
+
[Ignore("Remove to run test")]
|
18
20
|
[Test]
|
19
21
|
public void Sum_to_10()
|
20
22
|
{
|
21
23
|
Assert.That(SumOfMultiples.To(new[] { 3, 5 }, 10), Is.EqualTo(23));
|
22
24
|
}
|
23
|
-
|
25
|
+
|
26
|
+
[Ignore("Remove to run test")]
|
24
27
|
[Test]
|
25
28
|
public void Sum_to_100()
|
26
29
|
{
|
27
30
|
Assert.That(SumOfMultiples.To(new[] { 3, 5 }, 100), Is.EqualTo(2318));
|
28
31
|
}
|
29
|
-
|
32
|
+
|
33
|
+
[Ignore("Remove to run test")]
|
30
34
|
[Test]
|
31
35
|
public void Sum_to_1000()
|
32
36
|
{
|
33
37
|
Assert.That(SumOfMultiples.To(new[] { 3, 5 }, 1000), Is.EqualTo(233168));
|
34
38
|
}
|
35
|
-
|
39
|
+
|
40
|
+
[Ignore("Remove to run test")]
|
36
41
|
[Test]
|
37
42
|
public void Sum_to_20()
|
38
43
|
{
|
39
44
|
Assert.That(SumOfMultiples.To(new [] { 7, 13, 17 }, 20), Is.EqualTo(51));
|
40
45
|
}
|
41
|
-
|
46
|
+
|
47
|
+
[Ignore("Remove to run test")]
|
42
48
|
[Test]
|
43
49
|
public void Sum_to_10000()
|
44
50
|
{
|