Skip to content

Commit

Permalink
Merge pull request #50 from ErikSchierboom/nunit3
Browse files Browse the repository at this point in the history
Upgrade to NUnit 3 (fixes #44)
  • Loading branch information
jwood803 committed Feb 5, 2016
2 parents d7a20e1 + 1b387f8 commit d4aefc5
Show file tree
Hide file tree
Showing 46 changed files with 456 additions and 456 deletions.
10 changes: 5 additions & 5 deletions accumulate/AccumulateTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ public void Empty_accumulation_produces_empty_accumulation()
Assert.That(new int[0].Accumulate(x => x * x), Is.EqualTo(new int[0]));
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Accumulate_squares()
{
Assert.That(new[] { 1, 2, 3 }.Accumulate(x => x * x), Is.EqualTo(new[] { 1, 4, 9 }));
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Accumulate_upcases()
{
Assert.That(new List<string> { "hello", "world" }.Accumulate(x => x.ToUpper()),
Is.EqualTo(new List<string> { "HELLO", "WORLD" }));
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Accumulate_reversed_strings()
{
Expand All @@ -42,7 +42,7 @@ private static string Reverse(string value)
return new string(array);
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Accumulate_within_accumulate()
{
Expand All @@ -51,7 +51,7 @@ public void Accumulate_within_accumulate()
Assert.That(actual, Is.EqualTo(new[] { "a1 a2 a3", "b1 b2 b3", "c1 c2 c3" }));
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Accumulate_is_lazy()
{
Expand Down
12 changes: 6 additions & 6 deletions acronym/AcronymTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ public void Empty_string_abbreviated_to_empty_string()
Assert.That(Acronym.Abbreviate(string.Empty), Is.EqualTo(string.Empty));
}

[TestCase("Portable Network Graphics", Result = "PNG", Ignore = true)]
[TestCase("Ruby on Rails", Result = "ROR", Ignore = true)]
[TestCase("HyperText Markup Language", Result = "HTML", Ignore = true)]
[TestCase("First In, First Out", Result = "FIFO", Ignore = true)]
[TestCase("PHP: Hypertext Preprocessor", Result = "PHP", Ignore = true)]
[TestCase("Complementary metal-oxide semiconductor", Result = "CMOS", Ignore = true)]
[TestCase("Portable Network Graphics", ExpectedResult = "PNG", Ignore = "Remove to run test case")]
[TestCase("Ruby on Rails", ExpectedResult = "ROR", Ignore = "Remove to run test case")]
[TestCase("HyperText Markup Language", ExpectedResult = "HTML", Ignore = "Remove to run test case")]
[TestCase("First In, First Out", ExpectedResult = "FIFO", Ignore = "Remove to run test case")]
[TestCase("PHP: Hypertext Preprocessor", ExpectedResult = "PHP", Ignore = "Remove to run test case")]
[TestCase("Complementary metal-oxide semiconductor", ExpectedResult = "CMOS", Ignore = "Remove to run test case")]
public string Phrase_abbreviated_to_acronym(string phrase)
{
return Acronym.Abbreviate(phrase);
Expand Down
18 changes: 9 additions & 9 deletions allergies/AllergiesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ public void No_allergies_means_not_allergic()
Assert.That(allergies.AllergicTo("strawberries"), Is.False);
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Allergic_to_eggs()
{
var allergies = new Allergies(1);
Assert.That(allergies.AllergicTo("eggs"), Is.True);
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Allergic_to_eggs_in_addition_to_other_stuff()
{
Expand All @@ -31,39 +31,39 @@ public void Allergic_to_eggs_in_addition_to_other_stuff()
Assert.That(allergies.AllergicTo("strawberries"), Is.False);
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void No_allergies_at_all()
{
var allergies = new Allergies(0);
Assert.That(allergies.List(), Is.Empty);
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Allergic_to_just_eggs()
{
var allergies = new Allergies(1);
Assert.That(allergies.List(), Is.EqualTo(new List<string> { "eggs" }));
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Allergic_to_just_peanuts()
{
var allergies = new Allergies(2);
Assert.That(allergies.List(), Is.EqualTo(new List<string> { "peanuts" }));
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Allergic_to_eggs_and_peanuts()
{
var allergies = new Allergies(3);
Assert.That(allergies.List(), Is.EqualTo(new List<string> { "eggs", "peanuts" }));
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Allergic_to_lots_of_stuff()
{
Expand All @@ -72,7 +72,7 @@ public void Allergic_to_lots_of_stuff()
Is.EqualTo(new List<string> { "strawberries", "tomatoes", "chocolate", "pollen", "cats" }));
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Allergic_to_everything()
{
Expand All @@ -91,7 +91,7 @@ public void Allergic_to_everything()
}));
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Ignore_non_allergen_score_parts()
{
Expand Down
16 changes: 8 additions & 8 deletions anagram/AnagramTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public void No_matches()
Assert.That(detector.Match(words), Is.EquivalentTo(results));
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Detect_simple_anagram()
{
Expand All @@ -22,7 +22,7 @@ public void Detect_simple_anagram()
Assert.That(detector.Match(words), Is.EquivalentTo(results));
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Detect_multiple_anagrams()
{
Expand All @@ -32,7 +32,7 @@ public void Detect_multiple_anagrams()
Assert.That(detector.Match(words), Is.EquivalentTo(results));
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Does_not_confuse_different_duplicates()
{
Expand All @@ -42,7 +42,7 @@ public void Does_not_confuse_different_duplicates()
Assert.That(detector.Match(words), Is.EquivalentTo(results));
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Identical_word_is_not_anagram()
{
Expand All @@ -52,7 +52,7 @@ public void Identical_word_is_not_anagram()
Assert.That(detector.Match(words), Is.EquivalentTo(results));
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Eliminate_anagrams_with_same_checksum()
{
Expand All @@ -62,7 +62,7 @@ public void Eliminate_anagrams_with_same_checksum()
Assert.That(detector.Match(words), Is.EquivalentTo(results));
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Eliminate_anagram_subsets()
{
Expand All @@ -72,7 +72,7 @@ public void Eliminate_anagram_subsets()
Assert.That(detector.Match(words), Is.EquivalentTo(results));
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Detect_anagrams()
{
Expand All @@ -82,7 +82,7 @@ public void Detect_anagrams()
Assert.That(detector.Match(words), Is.EquivalentTo(results));
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Anagrams_are_case_insensitive()
{
Expand Down
14 changes: 7 additions & 7 deletions atbash-cipher/AtbashTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
public class AtbashTest
{
// change Ignore to false to run test case or just remove 'Ignore = true'
[TestCase("no", Result = "ml")]
[TestCase("yes", Result = "bvh", Ignore = true)]
[TestCase("OMG", Result = "lnt", Ignore = true)]
[TestCase("mindblowingly", Result = "nrmwy oldrm tob", Ignore = true)]
[TestCase("Testing, 1 2 3, testing.", Result = "gvhgr mt123 gvhgr mt", Ignore = true)]
[TestCase("Truth is fiction.", Result = "gifgs rhurx grlm", Ignore = true)]
[TestCase("The quick brown fox jumps over the lazy dog.", Result = "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt", Ignore = true)]
[TestCase("no", ExpectedResult = "ml")]
[TestCase("yes", ExpectedResult = "bvh", Ignore = "Remove to run test case")]
[TestCase("OMG", ExpectedResult = "lnt", Ignore = "Remove to run test case")]
[TestCase("mindblowingly", ExpectedResult = "nrmwy oldrm tob", Ignore = "Remove to run test case")]
[TestCase("Testing, 1 2 3, testing.", ExpectedResult = "gvhgr mt123 gvhgr mt", Ignore = "Remove to run test case")]
[TestCase("Truth is fiction.", ExpectedResult = "gifgs rhurx grlm", Ignore = "Remove to run test case")]
[TestCase("The quick brown fox jumps over the lazy dog.", ExpectedResult = "gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt", Ignore = "Remove to run test case")]
public string Encodes_words_using_atbash_cipher(string words)
{
return Atbash.Encode(words);
Expand Down
28 changes: 14 additions & 14 deletions binary/BinaryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
public class BinaryTest
{
// change Ignore to false to run test case or just remove 'Ignore = true'
[TestCase("1", Result = 1)]
[TestCase("10", Result = 2, Ignore = true)]
[TestCase("11", Result = 3, Ignore = true)]
[TestCase("100", Result = 4, Ignore = true)]
[TestCase("1001", Result = 9, Ignore = true)]
[TestCase("11010", Result = 26, Ignore = true)]
[TestCase("10001101000", Result = 1128, Ignore = true)]
[TestCase("1", ExpectedResult = 1)]
[TestCase("10", ExpectedResult = 2, Ignore = "Remove to run test case")]
[TestCase("11", ExpectedResult = 3, Ignore = "Remove to run test case")]
[TestCase("100", ExpectedResult = 4, Ignore = "Remove to run test case")]
[TestCase("1001", ExpectedResult = 9, Ignore = "Remove to run test case")]
[TestCase("11010", ExpectedResult = 26, Ignore = "Remove to run test case")]
[TestCase("10001101000", ExpectedResult = 1128, Ignore = "Remove to run test case")]
public int Binary_converts_to_decimal(string binary)
{
return Binary.ToDecimal(binary);
}

[TestCase("carrot", Ignore = true)]
[TestCase("2", Ignore = true)]
[TestCase("5", Ignore = true)]
[TestCase("9", Ignore = true)]
[TestCase("134678", Ignore = true)]
[TestCase("abc10z", Ignore = true)]
[TestCase("carrot", Ignore = "Remove to run test case")]
[TestCase("2", Ignore = "Remove to run test case")]
[TestCase("5", Ignore = "Remove to run test case")]
[TestCase("9", Ignore = "Remove to run test case")]
[TestCase("134678", Ignore = "Remove to run test case")]
[TestCase("abc10z", Ignore = "Remove to run test case")]
public void Invalid_binary_is_decimal_0(string invalidValue)
{
Assert.That(Binary.ToDecimal(invalidValue), Is.EqualTo(0));
}

[Ignore]
[Ignore("Remove to run test")]
[Test]
public void Binary_can_convert_formatted_strings()
{
Expand Down
Loading

0 comments on commit d4aefc5

Please sign in to comment.