예제 #1
0
        public void FindMethodOk()
        {
            clsGame AGame  = new clsGame();
            Boolean Found  = false;
            Int32   GameId = 2;

            Found = AGame.Find(GameId);
            Assert.IsTrue(Found);
        }
예제 #2
0
        public void FindMethodOK()
        {
            clsGame aGame  = new clsGame();
            bool    found  = false;
            int     testId = 4;

            found = aGame.Find(testId);
            Assert.IsTrue(found);
        }
예제 #3
0
        public void TestInStockFound()
        {
            clsGame AGame  = new clsGame();
            Boolean Found  = false;
            Boolean OK     = true;
            Int32   GameId = 3;

            Found = AGame.Find(GameId);
            if (AGame.InStock != true)
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
예제 #4
0
        public void TestStockQuantityFound()
        {
            clsGame AGame  = new clsGame();
            Boolean Found  = false;
            Boolean OK     = true;
            Int32   GameId = 3;

            Found = AGame.Find(GameId);
            if (AGame.StockQuantity != 1000)
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
예제 #5
0
        public void TestGameDescriptionFound()
        {
            clsGame AGame  = new clsGame();
            Boolean Found  = false;
            Boolean OK     = true;
            Int32   GameId = 3;

            Found = AGame.Find(GameId);
            if (AGame.GameDescription != "Miles Morales discovers explosive powers that set him apart from his mentor, Peter Parker. Master his unique, bio-electric venom blast attacks and covert camouflage power alongside spectacular web-slinging acrobatics, gadgets and skills.")
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
예제 #6
0
        public void TestGameTitleFound()
        {
            clsGame AGame  = new clsGame();
            Boolean Found  = false;
            Boolean OK     = true;
            Int32   GameId = 3;

            Found = AGame.Find(GameId);
            if (AGame.GameTitle != "MARVEL'S SPIDER-MAN: MILES MORALES")
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
예제 #7
0
        public void TestReleaseDateFound()
        {
            clsGame AGame  = new clsGame();
            Boolean Found  = false;
            Boolean OK     = true;
            Int32   GameId = 3;

            Found = AGame.Find(GameId);
            if (AGame.ReleaseDate != Convert.ToDateTime("12/11/2020"))
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
예제 #8
0
        public void TestGameTitleFound()
        {
            clsGame aGame  = new clsGame();
            bool    found  = false;
            bool    ok     = true;
            int     testId = 4;

            found = aGame.Find(testId);
            if (aGame.GameTitle != "Adventures of Bork")
            {
                ok = false;
            }
            Assert.IsTrue(ok);
        }
예제 #9
0
        public void TestGameIdFound()
        {
            clsGame aGame  = new clsGame();
            bool    found  = false;
            bool    ok     = true;
            int     testId = 4;

            found = aGame.Find(testId);
            if (aGame.GameId != 4)
            {
                ok = false;
            }
            Assert.IsTrue(ok);
        }
예제 #10
0
        public void TestActiveFound()
        {
            clsGame aGame  = new clsGame();
            bool    found  = false;
            bool    ok     = true;
            int     testId = 4;

            found = aGame.Find(testId);
            if (aGame.Active != true)
            {
                ok = false;
            }
            Assert.IsTrue(ok);
        }
예제 #11
0
        public void TestDatePublishedFound()
        {
            clsGame aGame  = new clsGame();
            bool    found  = false;
            bool    ok     = true;
            int     testId = 4;

            found = aGame.Find(testId);
            if (aGame.DatePublished != (new DateTime(2021, 02, 21)))
            {
                ok = false;
            }
            Assert.IsTrue(ok);
        }
예제 #12
0
        public void TestDiscountFound()
        {
            clsGame aGame  = new clsGame();
            bool    found  = false;
            bool    ok     = true;
            int     testId = 4;

            found = aGame.Find(testId);
            if (aGame.Discount != 10)
            {
                ok = false;
            }
            Assert.IsTrue(ok);
        }
예제 #13
0
        public void TestPriceFound()
        {
            clsGame aGame  = new clsGame();
            bool    found  = false;
            bool    ok     = true;
            int     testId = 4;

            found = aGame.Find(testId);
            if (aGame.Price != 16.99)
            {
                ok = false;
            }
            Assert.IsTrue(ok);
        }
예제 #14
0
        public void TestPriceFound()
        {
            clsGame AGame  = new clsGame();
            Boolean Found  = false;
            Boolean OK     = true;
            Int32   GameId = 3;

            Found = AGame.Find(GameId);
            if (AGame.Price != Convert.ToDecimal(51.99))
            {
                OK = false;
            }
            Assert.IsTrue(OK);
        }
예제 #15
0
        public void TestGameIdFound()
        {
            clsGame aGame  = new clsGame();
            Boolean found  = false;
            Boolean ok     = true;
            int     testId = 17;

            found = aGame.Find(testId);
            if (aGame.GameId != 17)
            {
                ok = false;
            }
            Assert.IsTrue(ok);
        }
    protected void btnFind_Click(object sender, EventArgs e)
    {
        clsGame aGame = new clsGame();
        Int32   GameID;
        Boolean Found = false;

        GameID = Convert.ToInt32(txtGameId.Text);
        Found  = aGame.Find(GameID);
        if (Found == true)
        {
            lblError.Text                 = "";
            txtGameTitle.Text             = aGame.GameTitle;
            txtPrice.Text                 = aGame.Price.ToString();
            txtDiscount.Text              = aGame.Discount.ToString();
            calDatePublished.VisibleDate  = aGame.DatePublished;
            calDatePublished.SelectedDate = aGame.DatePublished;
            chkActive.Checked             = aGame.Active;
        }
        else
        {
            lblError.Text = "A record with that ID was not found";
        }
    }
예제 #17
0
    protected void btnFind_Click(object sender, EventArgs e)
    {
        //create an instance of the game class
        clsGame AGame = new clsGame();
        //variable to store the primary key
        Int32 GameId;
        //variable to store the result of the find operation
        Boolean Found = false;

        //get the primary key entered by the user
        GameId = Convert.ToInt32(txtGameId.Text);
        //find the record
        Found = AGame.Find(GameId);
        if (Found == true)
        {
            //display the values of the properties in the form
            txtGameId.Text          = AGame.GameId.ToString();
            txtGameTitle.Text       = AGame.GameTitle;
            txtGameDescription.Text = AGame.GameDescription;
            txtReleaseDate.Text     = AGame.ReleaseDate.ToString();
            txtPrice.Text           = AGame.Price.ToString();
            txtStockQuantity.Text   = AGame.StockQuantity.ToString();
        }
    }