using MileageTraker.Web.Utility;
using NUnit.Framework;

namespace Web.Tests.Utility
{
	[TestFixture]
	public class NameNormalizerTests
	{
		[Test]
		public void Normalize_With_Comma()
		{
			var normalized = NameNormalizer.Normalize("Dobalina, Bob");
			Assert.That(normalized, Is.EqualTo("Bob Dobalina"));
		}

		[Test]
		public void Normalize_Normal()
		{
			var normalized = NameNormalizer.Normalize("Bob Dobalina");
			Assert.That(normalized, Is.EqualTo("Bob Dobalina"));
		}

		[Test]
		public void Normalize_Suffix()
		{
			var normalized = NameNormalizer.Normalize("Dobalina, Bob JR");
			Assert.That(normalized, Is.EqualTo("Bob Dobalina JR."));
		}

		[Test]
		public void Normalize_Suffix_With_Period()
		{
			var normalized = NameNormalizer.Normalize("Dobalina, Bob JR.");
			Assert.That(normalized, Is.EqualTo("Bob Dobalina JR."));
		}
	}
}
