Пример #1
0
        public void HotelIDOk()
        {
            clsRooms NewRoom  = new clsRooms();         //create an instance of the class we want to create
            Int32    TestData = 7;                      //create some test data to assign to the property

            NewRoom.HotelID = TestData;                 //assign the data to the property
            Assert.AreEqual(NewRoom.HotelID, TestData); //test to see the two values are the same
        }
Пример #2
0
        public void PropertyInventoryOk()
        {
            clsRooms NewRoom  = new clsRooms();           //create an instance of the class we want to create
            string   TestData = "BlowDryer";              //create some test data to assign to the property

            NewRoom.Inventory = TestData;                 //assign the data to the property
            Assert.AreEqual(NewRoom.Inventory, TestData); //test to see the two values are the same
        }
Пример #3
0
        public void RoomTypeOk()
        {
            clsRooms NewRoom  = new clsRooms();          //create an instance of the class we want to create
            string   TestData = "Family Bed";            //create some test data to assign to the property

            NewRoom.RoomType = TestData;                 //assign the data to the property
            Assert.AreEqual(NewRoom.RoomType, TestData); //test to see the two values are the same
        }
Пример #4
0
        public void FindMethodOk()
        {
            clsRooms NewRoom    = new clsRooms(); //create an instance of the class we want to create
            Boolean  Found      = false;          // boolean variable to store the results of the validation
            Int32    RoomNumber = 1;              //create some test data to use with the method

            Found = NewRoom.Find(RoomNumber);     //invoke the method
            Assert.IsTrue(Found);                 // test to see that the result is correct
        }
Пример #5
0
        public void HotelIDMinusOne()
        {
            clsRooms NewRoom   = new clsRooms(); //create an instance of the class we want to create
            Boolean  OK        = false;          //boolean variable to store the result of the validation
            string   HotelID   = "";             // this should trigger an error
            string   Inventory = "Blow Dryer";
            string   RoomType  = "Family Bed";

            OK = NewRoom.Valid(HotelID, Inventory, RoomType); //invoke the method
            Assert.IsFalse(OK);
        }
Пример #6
0
        public void ValidMethodOK()
        {
            clsRooms NewRoom   = new clsRooms(); //create an instance of the class we want to create
            Boolean  OK        = false;          //boolean variablw to store the result of the validation
            string   HotelID   = "Hilton10AD";
            string   Inventory = "Blow Dryer";
            string   RoomType  = "Family Bed";                //create some test data to pass to the method

            OK = NewRoom.Valid(HotelID, Inventory, RoomType); //test to see that the result is correct
            Assert.IsTrue(OK);                                //test to see that the result is correct
        }
Пример #7
0
        public void InventoryMid()
        {
            clsRooms NewRoom   = new clsRooms(); //create an instance of the class we want to create
            Boolean  OK        = false;          //boolean variable to store the result of the validation
            string   HotelID   = "HLT10AD";
            string   Inventory = "Iron, Kettle"; // this should be ok
            string   RoomType  = "Family Bed";

            OK = NewRoom.Valid(HotelID, Inventory, RoomType); //invoke the method
            Assert.IsTrue(OK);
        }
Пример #8
0
        public void RoomTypeMinPlusOne()
        {
            clsRooms NewRoom   = new clsRooms(); //create an instance of the class we want to create
            Boolean  OK        = false;          //boolean variable to store the result of the validation
            string   RoomType  = "Twin B";       // this should be ok
            string   HotelID   = "HLT10AD";
            string   Inventory = "Blow Dryer";

            OK = NewRoom.Valid(HotelID, Inventory, RoomType); //invoke the method
            Assert.IsTrue(OK);
        }
Пример #9
0
        public void InventoryExtremeMax()
        {
            clsRooms NewRoom   = new clsRooms(); //create an instance of the class we want to create
            Boolean  OK        = false;          //boolean variable to store the result of the validation
            string   RoomType  = "Family Bed";
            string   HotelID   = "HLT10AD";
            string   Inventory = "";

            Inventory = Inventory.PadRight(500, 'I');                // this should trigger an error
            OK        = NewRoom.Valid(HotelID, Inventory, RoomType); //invoke the method
            Assert.IsFalse(OK);
        }
Пример #10
0
        public void RoomTypeMaxPlusOne()
        {
            clsRooms NewRoom  = new clsRooms(); //create an instance of the class we want to create
            Boolean  OK       = false;          //boolean variable to store the result of the validation
            string   RoomType = "";             // = "STDN Twin Bed"; // this should trigger and error

            RoomType = RoomType.PadRight(21, 'H');
            string HotelID   = "HLT10AD";
            string Inventory = "Blow Dryer";

            OK = NewRoom.Valid(HotelID, Inventory, RoomType); //invoke the method
            Assert.IsFalse(OK);
        }
Пример #11
0
        public void InstanceOk()
        {
            clsRooms NewRoom = new clsRooms(); //create an instance of the class we want to create

            Assert.IsNotNull(NewRoom);         //test to see that it exists
        }