Exemple #1
0
 public void Ordinalize()
 {
     foreach (var pair in TestData)
     {
         Assert.AreEqual(Inflector.Ordinalize(pair.Key), pair.Value);
     }
 }
Exemple #2
0
 public void TestOrdinalize()
 {
     Assert.AreEqual("1st", Inflector.Ordinalize(1));
     Assert.AreEqual("2nd", Inflector.Ordinalize(2));
     Assert.AreEqual("1002nd", Inflector.Ordinalize(1002));
     Assert.AreEqual("1003rd", Inflector.Ordinalize(1003));
 }
Exemple #3
0
 /// <summary>
 /// Returns the ordinal form of a number, eg: 2nd, 23rd 19th, 1st etc.
 /// </summary>
 /// <param name="number">The number to ordinalize</param>
 /// <returns>The ordinalized string of the number</returns>
 public static string Ordinalize(int number)
 {
     return(Inflector.Ordinalize(number));
 }
Exemple #4
0
 public void OrdanizeNumbersTest(int number, string ordanized)
 {
     Assert.AreEqual(Inflector.Ordinalize(number), ordanized);
 }