public void Ordinalize() { foreach (var pair in TestData) { Assert.AreEqual(Inflector.Ordinalize(pair.Key), pair.Value); } }
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)); }
/// <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)); }
public void OrdanizeNumbersTest(int number, string ordanized) { Assert.AreEqual(Inflector.Ordinalize(number), ordanized); }