Пример #1
0
        public void InstanceOk()
        {
            //create an instance of the class clsMovies
            clsMovies AnMovies = new clsMovies();

            //check to see that the class is not null
            Assert.IsNotNull(AnMovies);
        }
Пример #2
0
        public void RunTimePropertyOK()
        {
            //create an instance of the class we want to create
            clsMovies AMovie = new clsMovies();
            //create some test data to assign to the property
            string RunTime = "1hr 20mins";

            //assign the data to the property
            AMovie.RunTime = RunTime;
            //test to see that the two value are the same
            Assert.AreEqual(AMovie.RunTime, RunTime);
        }
Пример #3
0
        public void CategoryPropertyOK()
        {
            //create an instance of the class we want to create
            clsMovies AMovie = new clsMovies();
            //create some test data to assign to the property
            string Category = "Action";

            //assign the data to the property
            AMovie.Category = Category;
            //test to see that the two value are the same
            Assert.AreEqual(AMovie.Category, Category);
        }
Пример #4
0
        public void DirectorPropertyOK()
        {
            //create an instance of the class we want to create
            clsMovies AMovie = new clsMovies();
            //create some test data to assign to the property
            string Director = "John Seagul";

            //assign the data to the property
            AMovie.Director = Director;
            //test to see that the two value are the same
            Assert.AreEqual(AMovie.Director, Director);
        }
Пример #5
0
        public void DateReleasedPropertyOK()
        {
            //create an instance of the class we want to create
            clsMovies AMovie = new clsMovies();
            //create some test data to assign to the property
            int DateReleased = 01 / 12 / 2017;

            //assign the data to the property
            AMovie.DateReleased = DateReleased;
            //test to see that the two value are the same
            Assert.AreEqual(AMovie.DateReleased, DateReleased);
        }
Пример #6
0
        public void MovieIdPropertyOK()
        {
            //create an instance of the class we want to create
            clsMovies AMovie = new clsMovies();
            //create some test data to assign to the property
            Int32 MovieId = 1;

            //assign the data to the property
            AMovie.MovieId = MovieId;
            //test to see that the two value are the same
            Assert.AreEqual(AMovie.MovieId, MovieId);
        }
Пример #7
0
        //used to test the movie property of the class
        public void MoviePropertyOK()
        {
            //create an instance of the class
            clsMovies AMovie = new clsMovies();
            //create some test data to assign to the property
            string SomeMovie = "Shrek";

            //assign the data to the property
            AMovie.Movie = SomeMovie;
            //test to see that the two values are the same
            Assert.AreEqual(AMovie.Movie, SomeMovie);
        }
Пример #8
0
        public void MovieMid()
        {
            //create an instance of the class we want to create
            clsMovies AMovie = new clsMovies();
            //create a string variable to store the result of the validation
            string Error = "";
            //create some test data to test the method
            string SomeMovie = "0123456789012345678901234";

            //invoke the method
            Error = AMovie.Valid(SomeMovie);
            //test to see that the result is NOT OK
            Assert.AreEqual(Error, "");
        }
Пример #9
0
        public void MovieExtremeMax()
        {
            //create an instance of the class we want to create
            clsMovies AMovie = new clsMovies();
            //create a string variable to store the result of the validation
            string Error = "";
            //create some test data to test the method
            string SomeMovie = "";

            //pad the string with characters
            SomeMovie = SomeMovie.PadRight(500, 'a');
            //invoke the method
            Error = AMovie.Valid(SomeMovie);
            //test to see that the result is NOT OK
            Assert.AreNotEqual(Error, "");
        }
Пример #10
0
        public void CountMatchesList()
        {
            //create an instance of the class we want to create
            clsMovieCollection Movies = new clsMovieCollection();
            //create some test data to assign to the property
            //in this case the data needs to be a list of objects
            List <clsMovies> TestList = new List <clsMovies>();
            //add an item to the list
            //create the item of the test data
            clsMovies TestItem = new clsMovies();

            //set its properties
            TestItem.MovieId = 1;
            TestItem.Movie   = "Shrek";
            //add the item to the test list
            TestList.Add(TestItem);
            //assign the data to the property
            Movies.AllMovies = TestList;
            //test to see that the two values are the same
            Assert.AreEqual(Movies.Count, TestList.Count);
        }