Esempio n. 1
0
        public void InstanceOk()
        {
            //create an instance of the class clsMovies
            clsCinema AnCinema = new clsCinema();

            //check to see that the class is not null
            Assert.IsNotNull(AnCinema);
        }
Esempio n. 2
0
        public void CinemaIdPropertyOK()
        {
            //create an instance of the class we want to create
            clsCinema ACinema = new clsCinema();
            //create some test data to assign to the property
            Int32 CinemaId = 1;

            //assign the data to the property
            ACinema.CinemaId = CinemaId;
            //test to see that the two value are the same
            Assert.AreEqual(ACinema.CinemaId, CinemaId);
        }
Esempio n. 3
0
        public void CinemaPropertyOK()
        {
            //create an instance of the class
            clsCinema ACinema = new clsCinema();
            //create some test data to assign to the property
            string SomeCinema = "Leicester";

            //assign the data to the property
            ACinema.Cinema = SomeCinema;
            //test to see that the two values are the same
            Assert.AreEqual(ACinema.Cinema, SomeCinema);
        }
Esempio n. 4
0
        public void CinemaMinPlusOne()
        {
            //create an instance of the class we want to create
            clsCinema ACinema = new clsCinema();
            //create a string variable to store the result of the validation
            string Error = "";
            //create some test data to test the method
            string SomeCinema = "aa";

            //invoke the method
            Error = ACinema.Valid(SomeCinema);
            //test to see that the result is NOT OK
            Assert.AreEqual(Error, "");
        }
Esempio n. 5
0
        public void CinemaExtremeMax()
        {
            //create an instance of the class we want to create
            clsCinema ACinema = new clsCinema();
            //create a string variable to store the result of the validation
            string Error = "";
            //create some test data to test the method
            string SomeCinema = "";

            //pad the string with characters
            SomeCinema = SomeCinema.PadRight(500, 'a');
            //invoke the method
            Error = ACinema.Valid(SomeCinema);
            //test to see that the result is NOT OK
            Assert.AreNotEqual(Error, "");
        }
Esempio n. 6
0
        public void CountMatchesList()
        {
            //create an instance of the class we want to create
            clsCinemaCollection Cinema = new clsCinemaCollection();
            //create some test data to assign to the property
            //in this case the data needs to be a list of objects
            List <clsCinema> TestList = new List <clsCinema>();
            //add an item to the list
            //create the item of the test data
            clsCinema TestItem = new clsCinema();

            //set its properties
            TestItem.CinemaId = 5;
            TestItem.Cinema   = "Leicester";
            //add the item to the test list
            TestList.Add(TestItem);
            //assign the data to the property
            Cinema.AllCinema = TestList;
            //test to see that the two values are the same
            Assert.AreEqual(Cinema.Count, TestList.Count);
        }