Exemplo n.º 1
0
        /// <summary>
        /// Nathaniel Webber
        /// Created: 2021/03/10
        ///
        /// This method grabs the corresponding stored procedure from the sql
        /// and uses it to deactivate an award in the database
        /// </summary>
        public int DeactivateAwardByUserIDAndAwardName(int awardID)
        {
            int rowsAffected;

            try
            {
                rowsAffected = _awardAccessor.SafelyDeactivateAwardByAwardName(awardID);
            }
            catch (Exception ex)
            {
                throw new ApplicationException("Award could not be Deactivated" + ex.InnerException);
            }

            return(rowsAffected);
        }
Exemplo n.º 2
0
        public void TestDeactivateAward()
        {
            // Arrange
            Award newAward = new Award
            {
                AwardID          = 2,
                AwardName        = "Test Award",
                AwardDescription = "Test Description",
                GoalID           = 2,
                GoalTypeID       = 2,
                Active           = true
            };

            // Act
            int deactivated = awardAccessor.SafelyDeactivateAwardByAwardName(2);

            // Assert
            Assert.IsTrue(deactivated == 0);
        }