示例#1
0
        /// <summary>
        /// Nathaniel Webber
        /// Created: 2021/03/10
        ///
        /// This method grabs the corresponding stored procedure from the sql
        /// and uses it to create an award in the database
        /// </summary>
        public int CreateAward(int userID, string awardName, string awardDescription)
        {
            int rowsAffected;

            try
            {
                rowsAffected = _awardAccessor.CreateNewAward(userID, awardName, awardDescription);
            }
            catch (Exception ex)
            {
                throw new ApplicationException("Award could not be created" + ex.InnerException);
            }

            return(rowsAffected);
        }
示例#2
0
        public void TestCreateAward()
        {
            // Arrange
            int    userID           = 1;
            int    awardID          = 5;
            string awardName        = "Test Award";
            string awardDescription = "Test Description";
            int    goalID           = 3;
            int    goalTypeID       = 3;

            // Act
            int createAward = awardAccessor.CreateNewAward(userID, awardName, awardDescription);

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