예제 #1
0
        public void NameFormattingTest()
        {
            var p1 = new Person()
            {
                LastName   = "Smith",
                FirstName  = "John",
                MiddleName = "Andrew"
            };

            var p2 = new Person()
            {
                LastName  = "Doe",
                FirstName = "Jane"
            };

            Assert.AreEqual(p1.GetFormattedName(NameFormats.FirstMiddleInitialLast),
                            "John A. Smith");

            Assert.AreEqual(p1.GetFormattedName(NameFormats.LastFirstMiddleInitial),
                            "Smith, John A.");

            Assert.AreEqual(p2.GetFormattedName(NameFormats.FirstMiddleInitialLast),
                            "Jane Doe");

            Assert.AreEqual(p2.GetFormattedName(NameFormats.LastFirstMiddleInitial),
                            "Doe, Jane");
        }