Ejemplo n.º 1
0
        public void InstanceOK()
        {
            //create an instance of the class we want to create
            clsFilm AnFilm = new clsFilm();

            //test to see that it exists
            Assert.IsNotNull(AnFilm);
        }
Ejemplo n.º 2
0
        public void FilmDescriptionProperty()
        {
            //create an instance of the class we want to create
            clsFilm AnFilm = new clsFilm();
            //create some test data to assign to the property
            string TestData = "Jaws";

            //assign the data to the proerty
            AnFilm.FilmDescription = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(AnFilm.FilmDescription, TestData);
        }
Ejemplo n.º 3
0
        public void YearReleasedProperty()
        {
            //create an instance of the class we want to create
            clsFilm AnFilm = new clsFilm();
            //create some test data to assign to the property
            DateTime TestData = DateTime.Now.Date;

            //assign the data to the proerty
            AnFilm.YearReleased = TestData;
            //test to see that the two values are the same
            Assert.AreEqual(AnFilm.YearReleased, TestData);
        }
Ejemplo n.º 4
0
        public void FilmNameMinusOneMinBoundary()
        {
            //create instance of the class we want to create
            clsFilm AFilm = new clsFilm();
            // boolean variable to store the result of the validation
            Boolean Ok = false;
            //create some test data to assign to the property
            string   FilmName        = "WO";
            string   FilmDescription = "About something interesting";
            DateTime YearReleased    = DateTime.Now.Date;

            //invoke the method
            Ok = AFilm.Valid(FilmName, FilmDescription, YearReleased);
            //test tto see that the reuslt is correct
            Assert.IsFalse(Ok);
        }
Ejemplo n.º 5
0
        public void ValidMethodOK()
        {
            //create an instance of the class we want to create
            clsFilm AFilm = new clsFilm();
            //boolean variable to store the result of the validation
            Boolean Ok = false;
            //create some data to use with the method
            string   FilmName        = "Jaws";
            string   FilmDescription = "About something interesting";
            DateTime YearReleased    = DateTime.Now.Date;

            //invoke the method
            Ok = AFilm.Valid(FilmName, FilmDescription, YearReleased);
            //test tto see that the reuslt is correct
            Assert.IsTrue(Ok);
        }
Ejemplo n.º 6
0
        public void YearReleasedMidBoundary()
        {
            //create instance of the class we want to create
            clsFilm AFilm = new clsFilm();
            // boolean variable to store the result of the validation
            Boolean Ok = false;
            //create some test data to assign to the property
            string   FilmName        = "Jaws";
            string   FilmDescription = "John Cena";
            DateTime YearReleased    = DateTime.Now.AddYears(-7);

            //invoke the method
            Ok = AFilm.Valid(FilmName, FilmDescription, YearReleased);
            //test tto see that the reuslt is correct
            Assert.IsTrue(Ok);
        }
Ejemplo n.º 7
0
        public void FilmDescriptionExtremeMaxBoundary()
        {
            //create instance of the class we want to create
            clsFilm AFilm = new clsFilm();
            // boolean variable to store the result of the validation
            Boolean Ok = false;
            //create some test data to assign to the property
            string FilmName        = "Jaws";
            string FilmDescription = "";

            FilmDescription = FilmDescription.PadRight(100, 'a');
            DateTime YearReleased = DateTime.Now.Date;

            //invoke the method
            Ok = AFilm.Valid(FilmName, FilmDescription, YearReleased);
            //test tto see that the reuslt is correct
            Assert.IsFalse(Ok);
        }