Exemplo n.º 1
0
        public void AddNewPersonModelIntegrity()
        {
            // arrange
            PersonModel             newPerson    = null;
            IAgeRange <PersonModel> AgeRangeTest = new AgeRange();
            string ExpectedResult = "New Person Object cannot be null";
            // act
            string ActualResult = AgeRangeTest.AddNewPerson(newPerson);

            // assert
            Assert.AreEqual(ExpectedResult, ActualResult, "Invalid Details for the person have been supplied");
        }
Exemplo n.º 2
0
        public void AddNewPersonModelAgeNameIntegrity()
        {
            // arrange
            PersonModel newPerson = new PersonModel();

            newPerson.PersonFirstName = "Tony";
            newPerson.PersonLastName  = "Hawk";
            newPerson.CurrentAge      = "";
            IAgeRange <PersonModel> AgeRangeTest = new AgeRange();
            string ExpectedResult = "The person's age must be a valid number";
            // act
            string ActualResult = AgeRangeTest.AddNewPerson(newPerson);

            // assert
            Assert.AreEqual(ExpectedResult, ActualResult, "Invalid Details for the person have been supplied");
        }
Exemplo n.º 3
0
        public void AddNewPersonModelLastNameIntegrity()
        {
            // arrange
            PersonModel newPerson = new PersonModel();

            newPerson.PersonFirstName = "Tony";
            newPerson.PersonLastName  = "";
            newPerson.CurrentAge      = -1;
            IAgeRange <PersonModel> AgeRangeTest = new AgeRange();
            string ExpectedResult = "Input Value was Null or Empty";
            // act
            string ActualResult = AgeRangeTest.AddNewPerson(newPerson);

            // assert
            Assert.AreEqual(ExpectedResult, ActualResult, "Invalid Details for the person have been supplied");
        }