Ejemplo n.º 1
0
        public void TestActivateProduct()
        {
            //Arrange
            int    expected      = 1;
            string testProductID = "1234567890124";

            //Act
            int actual = _productAccessor.ActivateProduct(testProductID);

            //Assert
            Assert.AreEqual(expected, actual);
        }
        /// <summary>
        /// Creator: Cash Carlson
        /// Created: 2020/04/29
        /// Approver: Rasha Mohammed
        ///
        /// Method to Activate a Product by ProductID
        /// </summary>
        /// <param name="productID"></param>
        /// <returns></returns>
        public bool ActivateProduct(string productID)
        {
            bool result = false;

            try
            {
                result = _productAccessor.ActivateProduct(productID) == 1;
            }
            catch (Exception ex)
            {
                throw new ApplicationException("Activatation failed", ex);
            }

            return(result);
        }