Ejemplo n.º 1
0
        public void BusinessContact_IsDeleteValid()
        {
            //Arrange: A standard contact is created
            BContact contact = new BContact ();

            //Act: the contact is checked to be valid for creation.
            bool valid = contact.DeleteValid();

            //Assert: The contact is valid for creation
            Assert.AreEqual(true, valid);
        }
Ejemplo n.º 2
0
        public void BusinessContact_WithInvalidMembers_IsNotCreateValid()
        {
            //Arrange: A contact with an invalid first and last name is created.
            BContact contact = new BContact { First_Name = null, Last_Name = null };

            //Act: the contact is checked to be valid for creation.
            bool valid = contact.CreateValid();

            //Assert: The contact is not valid for creation
            Assert.AreEqual(false, valid);
        }
Ejemplo n.º 3
0
        public void BusinessContact_ComparedToOthers_IsNotEquivilant()
        {
            //Arrange: A contact with a normal first and last name is created.
            BContact contact = new BContact { First_Name = "John", Last_Name = "Smith" };

            //Act: the contact is checked against itself to be equivilant.
            bool equals = contact.Equivilant(contact);

            //Assert: The contact is not equivilant.
            Assert.AreEqual(false, equals);
        }
Ejemplo n.º 4
0
        public void BusinessContact_WithValidMembers_IsUpdateValid()
        {
            //Arrange: A contact with a valid first and last name.
            BContact contact = new BContact { First_Name = null, Last_Name = null };

            //Act: the contact is checked to be valid for updating.
            bool valid = contact.UpdateValid();

            //Assert: The contact is valid for updating
            Assert.AreEqual(true, valid);
        }
Ejemplo n.º 5
0
        public void BusinessContact_WithValidMembers_IsCreateValid()
        {
            //Arrange: A contact with a valid first and last name is created.
            BContact contact = new BContact {
                First_Name = "John",
                Last_Name = "Smith",
                username="******"
            };

            //Act: the contact is checked to be valid for creation.
            bool valid = contact.CreateValid();

            //Assert: The contact is valid for creation
            Assert.AreEqual(true, valid);
        }