Skip to content

Commit

Permalink
Add enahance setting name unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chengwei.shiu committed Nov 27, 2019
1 parent 7214646 commit dc9371f
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions src/GUI/UnitTests/PluralizerTest.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using NUnit.Framework;
using Humanizer;
using System.Collections.Generic;
using ReverseEngineer20.ReverseEngineer;

namespace UnitTests
{
Expand Down Expand Up @@ -405,5 +407,68 @@ public void Issue221(string word, string expectedResult)
// Assert
Assert.That(result, Is.EqualTo(expectedResult));
}

[Test]
public void InflectorPluralizerVariables()
{
var expected = "TableVariables";

var exampleOption = new List<Schema>
{
new Schema
{
SchemaName = "machine",
UseSchemaName = false,
Tables = new List<TableRenamer>
{
new TableRenamer
{
Name = "old_table",
VariableName = "TableVariables",
}
}
}
};

var sut = new InflectorPluralizer(exampleOption);

//Act
var actResult = sut.Pluralize("OldTable");

//Assert
StringAssert.Contains(expected, actResult);
}

[Test]
public void InflectorPluralizerNewName()
{
var expected = "NewTable";

var exampleOption = new List<Schema>
{
new Schema
{
SchemaName = "machine",
UseSchemaName = false,
Tables = new List<TableRenamer>
{
new TableRenamer
{
Name = "old_table",
NewName = "NewTable",
VariableName = "TableVariables",
}
}
}
};

var sut = new InflectorPluralizer(exampleOption);

//Act
var actResult = sut.Singularize("OldTable");

//Assert
StringAssert.Contains(expected, actResult);
}
}
}

0 comments on commit dc9371f

Please sign in to comment.