Exemple #1
0
        public void FormatNameMaximumLengthTest()
        {
            string familyName = "VeryLongFamilyName9012345678901234567890";

            string givenName     = "VeryLongGivenName89012345678901234567890";
            string title         = "VeryLongTitle8901234567890123456789";
            string formattedName = PatientName.Format(familyName, givenName, title);

            Assert.AreEqual(
                formattedName,
                familyName.ToUpper(CultureInfo.CurrentCulture) + ", " + givenName + " (" + title + ")",
                "Max length formatted name not as expected");
        }
Exemple #2
0
        public void FormatNameTruncationTest()
        {
            string familyName = "VeryLongFamilyName9012345678901234567890ThisShouldBeTruncated";

            string givenName     = "VeryLongGivenName89012345678901234567890ThisShouldBeTruncated";
            string title         = "VeryLongTitle8901234567890123456789ThisShouldBeTruncated";
            string formattedName = PatientName.Format(familyName, givenName, title);

            Assert.AreEqual(
                formattedName,
                "VERYLONGFAMILYNAME9012345678901234567..., VeryLongGivenName89012345678901234567... (VeryLongTitle8901234567890123456...)",
                "Formatted name not truncated as expected");
        }
Exemple #3
0
        public void FormatNameTest()
        {
            string formattedName = PatientName.Format(string.Empty, string.Empty, string.Empty);

            Assert.AreEqual(formattedName, string.Empty, "Expected formatted name to initially be empty string");

            formattedName = PatientName.Format("Evans", string.Empty, string.Empty);
            Assert.AreEqual(formattedName, "EVANS", "Expected formatted name to be 'EVANS'");

            formattedName = PatientName.Format("Evans", "John", string.Empty);
            Assert.AreEqual(formattedName, "EVANS, John", "Expected formatted name to be 'EVANS John'");

            formattedName = PatientName.Format("Evans", "John", "Mr");
            Assert.AreEqual(formattedName, "EVANS, John (Mr)", "Expected formatted name to be 'EVANS John (Mr)'");

            formattedName = PatientName.Format(string.Empty, "John", "Mr");
            Assert.AreEqual(formattedName, "John (Mr)", "Expected formatted name to be 'John (Mr)'");

            formattedName = PatientName.Format(string.Empty, string.Empty, "Mr");
            Assert.AreEqual(formattedName, string.Empty, "Expected formatted name to be ''");

            formattedName = PatientName.Format(string.Empty, "John", string.Empty);
            Assert.AreEqual(formattedName, "John", "Expected formatted name to be 'John'");
        }