コード例 #1
0
        public void Test_Construct_HabaneroApplicationException_WithDeveloperMessage_ShouldHaveDevMessage()
        {
            //---------------Set up test pack-------------------
            const string expectedDevMessage = "DeveloperMessage";
            const string expectedUserMessage = "IserMessage";
            //---------------Assert Precondition----------------

            //---------------Execute Test ----------------------
            var habaneroApplicationException = new HabaneroApplicationException(expectedUserMessage, expectedDevMessage);
            //---------------Test Result -----------------------
            Assert.AreEqual(expectedUserMessage, habaneroApplicationException.Message);
            Assert.AreEqual(expectedDevMessage, habaneroApplicationException.DeveloperMessage);
        }
コード例 #2
0
 /// <summary>
 /// Updates the value on the control from the corresponding property
 /// on the represented <see cref="IControlMapper.BusinessObject"/>.
 /// This also updates the Error Provider with any Error Messages.
 /// </summary>
 public virtual void UpdateControlValueFromBusinessObject()
 {
     try
     {
         _logger.Log("Start UpdateControlValueFromBusinessObject (" + this.BusinessObject + ") For Mapper (" + this.Control.Name + ")", LogCategory.Debug);
         //This calls a method that specifically knows how to update
         // the control with the BOProp value. 
         // This is an implementation of the GOF Template Method.
         InternalUpdateControlValueFromBo();
         this.UpdateErrorProviderErrorMessage();
     }
     catch (Exception e)
     {
         string additionalMessage = "There was a problem updating the Control '" + Control.Name + "' of type " +
                                    Control.GetType() + " mapped to the property '" + this.PropertyName + "'" + Environment.NewLine;
         var message = additionalMessage + e.Message;
         var exception = new HabaneroApplicationException(message, message, e);
         throw exception;
     }
 }