Example #1
0
        public void Can_Get_Simple_First_And_LastNames_From_IAddress()
        {
            //// Arrange
            var address = new Address() { Name = "John Doe" };

            //// Act
            var firstName = address.TrySplitFirstName();
            var lastName = address.TrySplitLastName();

            //// Assert
            Assert.AreEqual("John", firstName);
            Assert.AreEqual("Doe", lastName);
        }
Example #2
0
        public void Can_Prove_LastName_Is_Empty_If_Not_Provided()
        {
            //// Arrange
            var address = new Address() { Name = "John" };

            //// Act
            var firstName = address.TrySplitFirstName();
            var lastName = address.TrySplitLastName();

            //// Assert
            Assert.AreEqual("John", firstName);
            Assert.IsEmpty(lastName);
        }
Example #3
0
        public void Can_Get_A_Multiple_Word_LastName()
        {
            //// Arrange
            var address = new Address() { Name = "John El Macho" };

            //// Act
            var firstName = address.TrySplitFirstName();
            var lastName = address.TrySplitLastName();

            //// Assert
            Assert.AreEqual("John", firstName);
            Assert.AreEqual("El Macho", lastName);
        }