public void ShouldUpdateTheCustomersName()
        {
            var cust = new Customer {
                Id = 5, Name = "John Doe"
            };
            var cmd     = new ChangeCustomerCommand(cust);
            var newName = "Billy Bob";

            cmd.Execute(newName);
            Assert.Equal(newName, cmd.Customer.Name);
        }
        public void ShouldRollBackTheChange()
        {
            var originalName = "John Doe";
            var cust         = new Customer {
                Id = 5, Name = originalName
            };
            var cmd     = new ChangeCustomerCommand(cust);
            var newName = "Billy Bob";

            cmd.Execute(newName);
            cmd.UnExecute();
            Assert.Equal(originalName, cmd.Customer.Name);
            Assert.Equal(5, cmd.Customer.Id);
        }
        public void ShouldUpdateTheCustomersName()
        {
            // Arrange
            var cust = new Customer {
                Id = 5, Name = "John Doe"
            };
            var cmd      = new ChangeCustomerCommand(cust);
            var expected = "Billy Bob";

            // Action
            cmd.Execute(expected);

            // Assert
            Assert.AreEqual(expected, cmd.Customer.Name);
        }
        public void ShouldRollBackTheChange()
        {
            // Arrange
            var expectedName = "John Doe";
            var expectedId   = 5;
            var cust         = new Customer {
                Id = expectedId, Name = expectedName
            };
            var cmd     = new ChangeCustomerCommand(cust);
            var newName = "Billy Bob";

            cmd.Execute(newName);

            // Action
            cmd.UnExecute();

            // Assert
            Assert.AreEqual(expectedName, cmd.Customer.Name);
            Assert.AreEqual(expectedId, cmd.Customer.Id);
        }