Esempio n. 1
0
        public void FullNameLastNameEmpty()
        {
            //-- Arrange
            Customer customer = new Customer();
            customer.FirstName = "Luke";
            string expected = "Luke";

            //-- Act
            string actual = customer.FullName;

            //-- Assert
            Assert.AreEqual(expected, actual);
        }
Esempio n. 2
0
        public void FullNameTestValid()
        {
            // Arrange

            Customer customer = new Customer();

            customer.FirstName = "Luke";
            customer.LastName = "Skywalker";

            // string expected = "Luke Skywalker"; this breaks it
            string expected = "Skywalker, Luke";

            // Act

            string actual = customer.FullName;

            // Assert
            Assert.AreEqual(expected, actual);
        }
Esempio n. 3
0
        public void staticTest()
        {
            // Arrange
            var c1 = new Customer();
            c1.FirstName = "Han";
            Customer.InstanceCount += 1;

            var c2 = new Customer();
            c2.FirstName = "Lando";
            Customer.InstanceCount += 1;

            var c3 = new Customer();
            c3.FirstName = "Chewbacca";
            Customer.InstanceCount += 1;

            // Act

            // Assert
            Assert.AreEqual(3, Customer.InstanceCount);
        }
Esempio n. 4
0
        public void ValidateValid()
        {
            //-- Arrange
            var customer = new Customer();
            customer.LastName = "Antilles";
            customer.EmailAddress = "*****@*****.**";

            var expected = true;

            //-- Act
            var actual = customer.Validate();

            //-- Assert
            Assert.AreEqual(expected, actual);
        }