Exemplo n.º 1
0
        public void ShouldCreateNewObjectWhenRenaming()
        {
            var firstName   = "Test";
            var lastName    = "Test2";
            var address     = new Address("Test", 6, "32-091");
            var information = new BasicUserInformation(firstName, lastName, address);

            var newFirstName   = "NewTest";
            var newLastName    = "NewTest2";
            var newInformation = information.Rename(newFirstName, newLastName);

            newInformation.ShouldNotBeSameAs(information);
        }
Exemplo n.º 2
0
        public void ShouldChangeTheFirstAndLastNames()
        {
            var firstName   = "Test";
            var lastName    = "Test2";
            var address     = new Address("Test", 6, "32-091");
            var information = new BasicUserInformation(firstName, lastName, address);

            information.FirstName.ShouldBe(firstName);
            information.LastName.ShouldBe(lastName);
            information.Address.ShouldBe(address);

            var newFirstName = "NewTest";
            var newLastName  = "NewTest2";

            information = information.Rename(newFirstName, newLastName);

            information.FirstName.ShouldBe(newFirstName);
            information.LastName.ShouldBe(newLastName);
            information.Address.ShouldBe(address);
        }
Exemplo n.º 3
0
 public void Rename(string firstName, string lastName)
 {
     BasicUserInformation = BasicUserInformation.Rename(firstName, lastName);
 }