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 delete an award in the database
        /// </summary>
        public int DeleteAward(int awardID)
        {
            int rowsAffected = 0;

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

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

            // Act
            int delete = awardAccessor.DeleteAward(2);

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