コード例 #1
0
ファイル: tstGames.cs プロジェクト: Pyogesh11/ProjectWork
        public void ValidMethodOK()
        {
            //create an instanc eof the class we want to create
            clsGames AGame = new clsGames();
            //string variable to store any error message
            String Error = "";

            //invoke the method
            Error = AGame.Valid(Game_Name, Game_Description, Game_Quantity, Platform, Supplier_ID);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
コード例 #2
0
ファイル: tstGames.cs プロジェクト: Pyogesh11/ProjectWork
        public void Game_NameMinPlusOne()
        {
            //cretae an instnac eof the class we want to create
            clsGames AGame = new clsGames();
            //boolean variable to store the result
            String Error = "";
            //create some test data to pass to the method
            string Game_Name = "aaa";//this should pass

            Error = AGame.Valid(this.Game_Name, Game_Description, Game_Quantity, Platform, Supplier_ID);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
コード例 #3
0
ファイル: tstGames.cs プロジェクト: Pyogesh11/ProjectWork
        public void Supplier_IDMinplusOne()
        {
            //create an insatnce of the class we want to create
            clsGames AGame = new clsGames();
            //string variable to storee any error message
            String Error = "";
            //create some tst data to pass to the method
            String Supplier_ID = "aa";//this should work

            //invoke the method
            Error = AGame.Valid(Game_Name, Game_Description, Game_Quantity, Platform, Supplier_ID);
            //test to see hat the result is correct
            Assert.AreEqual(Error, "");
        }
コード例 #4
0
ファイル: tstGames.cs プロジェクト: Pyogesh11/ProjectWork
        public void Game_NameMaxPlusOne()
        {
            //create an instance of the class you want to create
            clsGames AGame = new clsGames();
            //boolean variable to store the result of the validaiton
            String Error = "";
            //create some test data to pass to the method
            String Game_Name = "";

            Game_Name = Game_Name.PadRight(51, 'a');//this test should pass
            Error     = AGame.Valid(Game_Name, Game_Description, Game_Quantity, Platform, Supplier_ID);
            //tets to see the result is correct
            Assert.AreNotEqual(Error, "");
        }
コード例 #5
0
ファイル: tstGames.cs プロジェクト: Pyogesh11/ProjectWork
        public void PlatformMid()
        {
            //create an insatnce of the class we want to create
            clsGames AGame = new clsGames();
            //string variable to storee any error message
            String Error = "";
            //create some tst data to pass to the method
            String Platform = "";

            Platform = Platform.PadRight(50, 'a');    //this should trigger an error
            //invoke the method
            Error = AGame.Valid(Game_Name, Game_Description, Game_Quantity, Platform, Supplier_ID);
            //test to see that the result is correct
            Assert.AreEqual(Error, "");
        }
コード例 #6
0
ファイル: tstGames.cs プロジェクト: Pyogesh11/ProjectWork
        public void Game_NameExtremeMax()
        {
            //create an instance of the class we want to ceate
            clsGames AGame = new clsGames();
            //string variabe to tore any error message
            string Error = "";
            //create some test method to pass to the method
            string Game_Name = "";

            Game_Name = Game_Name.PadRight(500, 'a');
            //invoke the method
            Error = AGame.Valid(Game_Name, Game_Description, Game_Quantity, Platform, Supplier_ID);
            //test t see that the result is ok
            Assert.AreNotEqual(Error, "");
        }