public void ContainsFButShouldStillEndS() { var inflectionService = new EnglishInflectionService(); Assert.Equal("Affiliates", inflectionService.ToPlural("Affiliate")); Assert.Equal("Identifiers", inflectionService.ToPlural("Identifier")); Assert.Equal("Notifications", inflectionService.ToPlural("Notification")); Assert.Equal("Refunds", inflectionService.ToPlural("Refund")); }
public void CorrectlyChangesSpecialCases() { var inflectionService = new EnglishInflectionService(); Assert.Equal("People", inflectionService.ToPlural("Person")); Assert.Equal("Children", inflectionService.ToPlural("Child")); Assert.Equal("Mice", inflectionService.ToPlural("Mouse")); Assert.Equal("Slices", inflectionService.ToPlural("Slice")); Assert.Equal("Viri", inflectionService.ToPlural("Virus")); }
public void WordsAddedUsingAddInvariantWordAreNotPluralized() { var inflectionService = new EnglishInflectionService(); inflectionService.AddInvariantWord("Test"); Assert.Equal("Test", inflectionService.ToPlural("Test")); }
public void DoesNotTryToPluralizeWordsWithNoPluralVersion() { var inflectionService = new EnglishInflectionService(); var unpluralizableWords = new[] { "Equipment", "Information", "Money", "Species", "Series" }; foreach (var word in unpluralizableWords) { Assert.Equal(word, inflectionService.ToPlural(word)); } }
public void WordsCoveredByAddedRulesArePluralizedAccordingToThoseRules() { var inflectionService = new EnglishInflectionService(); inflectionService.AddRule("(.+)", @"$1zzz"); Assert.Equal("Customerzzz", inflectionService.ToPlural("Customer")); }
public void EmptyStringIsNotModified() { var inflectionService = new EnglishInflectionService(); Assert.Equal(string.Empty, inflectionService.ToPlural(string.Empty)); }
public void CorrectlyChangesWordsEndingYToEndIes() { var inflectionService = new EnglishInflectionService(); Assert.Equal("Stories", inflectionService.ToPlural("Story")); }
public void CorrectlyChangesStandardWordsByAppendingAnS() { var inflectionService = new EnglishInflectionService(); Assert.Equal("Customers", inflectionService.ToPlural("Customer")); Assert.Equal("Invoices", inflectionService.ToPlural("Invoice")); }
public void ChangesWordEndingManToEndMen() { var inflectionService = new EnglishInflectionService(); Assert.Equal("Women", inflectionService.ToPlural("Woman")); }
public void ChangesWordEndingLfToEndVes() { var inflectionService = new EnglishInflectionService(); Assert.Equal("Elves", inflectionService.ToPlural("Elf")); }