Skip to content

Replace Theory with Fact for Acronym exercise #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 35 additions & 11 deletions exercises/acronym/AcronymTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,44 @@
public class AcronymTest
{
[Fact]
public void Empty_string_abbreviated_to_empty_string()
public void Basic()
{
Assert.Equal(string.Empty, Acronym.Abbreviate(string.Empty));
Assert.Equal("PNG", Acronym.Abbreviate("Portable Network Graphics"));
}

[Theory(Skip = "Remove to run test")]
[InlineData("Portable Network Graphics", "PNG")]
[InlineData("Ruby on Rails", "ROR")]
[InlineData("HyperText Markup Language", "HTML")]
[InlineData("First In, First Out", "FIFO")]
[InlineData("PHP: Hypertext Preprocessor", "PHP")]
[InlineData("Complementary metal-oxide semiconductor", "CMOS")]
public void Phrase_abbreviated_to_acronym(string phrase, string expected)
[Fact(Skip = "Remove to run test")]
public void Lowercase_words()
{
Assert.Equal(expected, Acronym.Abbreviate(phrase));
Assert.Equal("ROR", Acronym.Abbreviate("Ruby on Rails"));
}

[Fact(Skip = "Remove to run test")]
public void Camelcase()
{
Assert.Equal("HTML", Acronym.Abbreviate("HyperText Markup Language"));
}

[Fact(Skip = "Remove to run test")]
public void Punctuation()
{
Assert.Equal("FIFO", Acronym.Abbreviate("First In, First Out"));
}

[Fact(Skip = "Remove to run test")]
public void All_caps_words()
{
Assert.Equal("PHP", Acronym.Abbreviate("PHP: Hypertext Preprocessor"));
}

[Fact(Skip = "Remove to run test")]
public void NonAcronymAllCapsWord()
{
Assert.Equal("GIMP", Acronym.Abbreviate("GNU Image Manipulation Program"));
}

[Fact(Skip = "Remove to run test")]
public void Hyphenated()
{
Assert.Equal("CMOS", Acronym.Abbreviate("Complementary metal-oxide semiconductor"));
}
}