Abbreviate() public static method

public static Abbreviate ( string phrase ) : string
phrase string
return string
Example #1
0
    public static void Main(String[] args)
    {
        string output = Acronym.Abbreviate("Something - I made up from thin air");

        Console.WriteLine(output);
        Console.ReadKey();
    }
Example #2
0
 public void Basic()
 {
     Assert.Equal("PNG", Acronym.Abbreviate("Portable Network Graphics"));
 }
Example #3
0
 public void Consecutive_delimiters()
 {
     Assert.Equal("SIMUFTA", Acronym.Abbreviate("Something - I made up from thin air"));
 }
Example #4
0
 public void Very_long_abbreviation()
 {
     Assert.Equal("ROTFLSHTMDCOALM", Acronym.Abbreviate("Rolling On The Floor Laughing So Hard That My Dogs Came Over And Licked Me"));
 }
Example #5
0
 public void Punctuation_without_whitespace()
 {
     Assert.Equal("CMOS", Acronym.Abbreviate("Complementary metal-oxide semiconductor"));
 }
Example #6
0
 public void All_caps_word()
 {
     Assert.Equal("GIMP", Acronym.Abbreviate("GNU Image Manipulation Program"));
 }
Example #7
0
 public void Punctuation()
 {
     Assert.Equal("FIFO", Acronym.Abbreviate("First In, First Out"));
 }
Example #8
0
 public void Lowercase_words()
 {
     Assert.Equal("ROR", Acronym.Abbreviate("Ruby on Rails"));
 }
Example #9
0
 public void Underscore_emphasis()
 {
     Assert.Equal("TRNT", Acronym.Abbreviate("The Road _Not_ Taken"));
 }
Example #10
0
 public void Hyphenated()
 {
     Assert.Equal("CMOS", Acronym.Abbreviate("Complementary metal-oxide semiconductor"));
 }
Example #11
0
 public void Apostrophes()
 {
     Assert.Equal("HC", Acronym.Abbreviate("Halley's Comet"));
 }
Example #12
0
 public void All_caps_words()
 {
     Assert.Equal("PHP", Acronym.Abbreviate("PHP: Hypertext Preprocessor"));
 }
Example #13
0
 public void NonAcronymAllCapsWord()
 {
     Assert.Equal("GIMP", Acronym.Abbreviate("GNU Image Manipulation Program"));
 }
Example #14
0
 public void Camelcase()
 {
     Assert.Equal("HTML", Acronym.Abbreviate("HyperText Markup Language"));
 }
Example #15
0
 public void Empty_string_abbreviated_to_empty_string()
 {
     Assert.That(Acronym.Abbreviate(string.Empty), Is.EqualTo(string.Empty));
 }
Example #16
0
 public string Phrase_abbreviated_to_acronym(string phrase)
 {
     return(Acronym.Abbreviate(phrase));
 }