コード例 #1
0
        public void makeNameTestSpecialChars()
        {
            String example = "Knowles-Carter, Beyonce ";
            Name   name    = NameUtilities.makeName(example);

            Assert.AreEqual(name.First, "Beyonce");
            Assert.AreEqual(name.Last, "Knowles-Carter");
        }
コード例 #2
0
        public void makeNameTestFirstLast()
        {
            String example = "Knowles, Beyonce";
            Name   name    = NameUtilities.makeName(example);

            Assert.AreEqual(name.First, "Beyonce");
            Assert.AreEqual(name.Last, "Knowles");
        }
コード例 #3
0
        public void makeNameTestOnlyFirst()
        {
            // This test fails - the makeName method throws an exception
            // The makeName method needs to be fixed
            String example = "Beyonce";
            Name   name    = NameUtilities.makeName(example);

            Assert.AreEqual(name.First, "Beyonce");
            Assert.AreEqual(name.Last, null);
        }