internal class ValidationCallHandler : ICallHandler { public IMethodReturn Invoke(IMethodInvocation input, GetNextHandlerDelegate getNext) { // Preprocessing if (IsValidated()) { return getNext()(input, getNext); } return input.CreateExceptionMethodReturn(new ValidationException()); } private Boolean IsValidated() { return false; } public int Order { get; set; } } [TestMethod] public void Be_Able_To_Validate_Account_Code_Setup() { AccountCodeSetup accountCodeSetup = _accountCodeSetupService.GetByName("Primary"); // SaveAccountCodeSetupChanges is intercepted by the ValidationCallHandler _accountCodeSetupService.SaveAccountCodeSetupChanges(accountCodeSetup); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)