Esempio n. 1
0
        public void InstanceOK()
        {
            //create an instance of the class clsMovies
            clsShowing AnShowing = new clsShowing();

            //check to see that the class is not null
            Assert.IsNotNull(AnShowing);
        }
Esempio n. 2
0
        //used to test the movie property of the class
        public void ShowingNamePropertyOK()
        {
            //create an instance of the class
            clsShowing AShowing = new clsShowing();
            //create some test data to assign to the property
            string SomeShowing = "Shrek";

            //assign the data to the property
            AShowing.ShowingName = SomeShowing;
            //test to see that the two values are the same
            Assert.AreEqual(AShowing.ShowingName, SomeShowing);
        }
Esempio n. 3
0
        public void ShowingIdPropertyOk()
        {
            //create an instance of the class
            clsShowing AShowing = new clsShowing();
            //create some test data to assign to the property
            Int32 ShowingId = 1;

            //assign the data to the property
            AShowing.ShowingId = ShowingId;
            //test to see that the two value are the same
            Assert.AreEqual(AShowing.ShowingId, ShowingId);
        }
Esempio n. 4
0
        public void ValidMethodOK()
        {
            //create an instance of the class we want to create
            clsShowing AShowing = new clsShowing();
            //create a string variable to store the result of the validation
            string Error = "";
            //create some test data to test the method
            string SomeShowing = "Shrek";

            //invoke the method
            Error = AShowing.Valid(SomeShowing);
            //test to see that the result is OK
            Assert.AreEqual(Error, "");
        }
Esempio n. 5
0
        public void AllShowingOK()
        {
            //create an instance of the class we want to create
            clsShowingCollection Showing = new clsShowingCollection();
            //create some test data to assign to the property
            //in this case the data needs to be a list of objects
            List <clsShowing> TestList = new List <clsShowing>();
            //add an item to the list
            //create the item of the test data
            clsShowing TestItem = new clsShowing();

            //set its properties
            TestItem.ShowingId   = 1;
            TestItem.ShowingName = "Shrek";
            //add the item to the test list
            TestList.Add(TestItem);
            //assign the data to the property
            Showing.AllShowing = TestList;
            //test to see that the two values are the same
            Assert.AreEqual(Showing.AllShowing, TestList);
        }