Skip to content
This repository has been archived by the owner on Dec 29, 2020. It is now read-only.

6.2.6 #420

Merged
merged 11 commits into from
Nov 5, 2015
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,24 @@ public void ChangesWordEndingLfToEndVes()
{
var inflectionService = new EnglishInflectionService();
Assert.Equal("Elves", inflectionService.ToPlural("Elf"));
Assert.Equal("Wolves", inflectionService.ToPlural("Wolf"));
}

[Fact]
public void ChangesWordEndingManToEndMen()
{
var inflectionService = new EnglishInflectionService();
Assert.Equal("Men", inflectionService.ToPlural("Man"));
Assert.Equal("Women", inflectionService.ToPlural("Woman"));
}

[Fact]
public void ShouldNotMutilateWordsHavingFInTheMiddle()
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"));
}

Expand Down
10 changes: 5 additions & 5 deletions MicroLite.Tests/Mapping/PocoObjectInfoTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public void GetIdentifierValueThrowsMicroLiteException_WhenNoIdentifierMapped()

var exception = Assert.Throws<MicroLiteException>(() => objectInfo.GetIdentifierValue(customer));

Assert.Equal(ExceptionMessages.PocoObjectInfo_NoIdentifierColumn.FormatWith("Sales", "CustomerWithNoIdentivesier"), exception.Message);
Assert.Equal(ExceptionMessages.PocoObjectInfo_NoIdentifierColumn.FormatWith("Sales", "CustomerWithNoIdentifiers"), exception.Message);
}

[Fact]
Expand Down Expand Up @@ -335,7 +335,7 @@ public void GetInsertValuesThrowsMicroLiteException_WhenNoIdentifierMapped()

var exception = Assert.Throws<MicroLiteException>(() => objectInfo.GetInsertValues(customer));

Assert.Equal(ExceptionMessages.PocoObjectInfo_NoIdentifierColumn.FormatWith("Sales", "CustomerWithNoIdentivesier"), exception.Message);
Assert.Equal(ExceptionMessages.PocoObjectInfo_NoIdentifierColumn.FormatWith("Sales", "CustomerWithNoIdentifiers"), exception.Message);
}

[Fact]
Expand Down Expand Up @@ -455,7 +455,7 @@ public void GetUpdateValuesThrowsMicroLiteException_WhenNoIdentifierMapped()

var exception = Assert.Throws<MicroLiteException>(() => objectInfo.GetUpdateValues(customer));

Assert.Equal(ExceptionMessages.PocoObjectInfo_NoIdentifierColumn.FormatWith("Sales", "CustomerWithNoIdentivesier"), exception.Message);
Assert.Equal(ExceptionMessages.PocoObjectInfo_NoIdentifierColumn.FormatWith("Sales", "CustomerWithNoIdentifiers"), exception.Message);
}

[Fact]
Expand Down Expand Up @@ -538,7 +538,7 @@ public void HasDefaultIdentifierValueThrowsMicroLiteException_WhenNoIdentifierMa

var exception = Assert.Throws<MicroLiteException>(() => objectInfo.HasDefaultIdentifierValue(customer));

Assert.Equal(ExceptionMessages.PocoObjectInfo_NoIdentifierColumn.FormatWith("Sales", "CustomerWithNoIdentivesier"), exception.Message);
Assert.Equal(ExceptionMessages.PocoObjectInfo_NoIdentifierColumn.FormatWith("Sales", "CustomerWithNoIdentifiers"), exception.Message);
}

[Fact]
Expand Down Expand Up @@ -697,7 +697,7 @@ public void VerifyInstanceForInsertThrowsMicroLiteException_WhenNoIdentifierMapp

var exception = Assert.Throws<MicroLiteException>(() => objectInfo.VerifyInstanceForInsert(customer));

Assert.Equal(ExceptionMessages.PocoObjectInfo_NoIdentifierColumn.FormatWith("Sales", "CustomerWithNoIdentivesier"), exception.Message);
Assert.Equal(ExceptionMessages.PocoObjectInfo_NoIdentifierColumn.FormatWith("Sales", "CustomerWithNoIdentifiers"), exception.Message);
}

public class CustomerWithGuidIdentifier
Expand Down
2 changes: 1 addition & 1 deletion MicroLite/Mapping/Inflection/EnglishInflectionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal sealed class EnglishInflectionService : IInflectionService
{ "Person", "People" },
{ "Child", "Children" },
{ "(.*)fe?$", "$1ves" },
{ "(.*)man$", "$1men" },
{ "(M|(.*)m)an$", "$1en" },
{ "(.+[aeiou]y)$", "$1s" },
{ "(.+[^aeiou])y$", "$1ies" },
{ "(.+z)$", "$1zes" },
Expand Down