public void SetUp()
        {
            mockContext = new DynamicMock(typeof(IApplicationContext));

            advice = new ParameterValidationAdvice();
            advice.ApplicationContext = (IApplicationContext)mockContext.Object;

            requiredValidator = new RequiredValidator();
            requiredValidator.Actions.Add(new ErrorMessageAction("error.required", "errors"));
        }
Esempio n. 2
0
        public void SetUp()
        {
            mockContext = A.Fake <IApplicationContext>();

            advice = new ParameterValidationAdvice();
            advice.ApplicationContext = mockContext;

            requiredValidator = new RequiredValidator();
            requiredValidator.Actions.Add(new ErrorMessageAction("error.required", "errors"));
        }
        public void SetUp()
        {
            mocks       = new MockRepository();
            mockContext = mocks.CreateMock <IApplicationContext>();

            advice = new ParameterValidationAdvice();
            advice.ApplicationContext = mockContext;

            requiredValidator = new RequiredValidator();
            requiredValidator.Actions.Add(new ErrorMessageAction("error.required", "errors"));
        }
        public void SetUp()
        {
            mocks = new MockRepository();
            mockContext = mocks.CreateMock<IApplicationContext>();

            advice = new ParameterValidationAdvice();
            advice.ApplicationContext = mockContext;

            requiredValidator = new RequiredValidator();
            requiredValidator.Actions.Add(new ErrorMessageAction("error.required", "errors"));
        }
 /// <summary>
 /// Creates new advisor instance.
 /// </summary>
 public ParameterValidationAdvisor()
 {
     Advice    = new ParameterValidationAdvice();
     Attribute = typeof(ValidatedAttribute);
     Inherit   = false;
 }
 /// <summary>
 /// Creates new advisor instance.
 /// </summary>
 public ParameterValidationAdvisor()
 {
     Advice = new ParameterValidationAdvice();
     Attribute = typeof(ValidatedAttribute);
     Inherit = false;
 }