public void Finaly(string methodName, IMethodArgs args, IMethodResult result) { foreach (var visitor in _visitors) { visitor.Finaly(methodName, args, result); } }
public DetailUpdateWindow(IMethodArgs Args) { InitializeComponent(); contentCtrl.DataContext = Args; UpdateWindow.Title = Args.methodType; }
public void Enter(string methodName, IMethodArgs args) { foreach (var visitor in _visitors) { visitor.Enter(methodName, args); } }
public Exception Catch(string methodName, IMethodArgs args, Exception exception) { foreach (var visitor in _visitors) { exception = visitor.Catch(methodName, args, exception); } return(exception); }
public override DataTemplate SelectTemplate(object item, DependencyObject container) { IMethodArgs args = item as IMethodArgs; if (item == null || args.methodType == "FullnameNormalize" || args.methodType == "UniqueID") { return(((FrameworkElement)container).FindResource("DefaultDetailTemplate") as DataTemplate); } return(((FrameworkElement)container).FindResource(args.methodType + "DetailTemplate") as DataTemplate); }
public IMethodResult CatchOverrideResult(string methodName, IMethodArgs args, Exception exception) { var lastResult = _visitors .OfType <ICatchResultsOverrider>() .Select(x => x.CatchOverrideResult(methodName, args, exception)) .Where(x => x != null) .LastOrDefault(); return(lastResult); }
public IMethodResult CatchOverrideResult(string methodName, IMethodArgs args, Exception exception) { var result = new MethodResult(); if (methodName.Equals(nameof(IDoSomthing.GoTask))) { result.Set(Task.FromResult(777)); } else if (methodName.Equals(nameof(IDoSomthing.GetInteger))) { result.Set(777); } return(result); }
public void Finaly(string methodName, IMethodArgs args, IMethodResult result) { }
public void Exit(string methodName, IMethodArgs args, IMethodResult result) { }
public Exception Catch(string methodName, IMethodArgs args, Exception exception) { _logger.Log($"Failed method {methodName}. Total time: {stopwatch.ElapsedMilliseconds} ms"); return(exception); }
public void Exit(string methodName, IMethodArgs args, IMethodResult result) { _logger.Log($"Successful method {methodName}. Total time: {stopwatch.ElapsedMilliseconds} ms"); }
public MockMethodParamAsserts(IMethod methodDeclaration, IMethodName methodName, IMethodArgs methodArgs) { _methodDeclaration = methodDeclaration; _methodName = methodName; _methodArgs = methodArgs; }
public void Enter(string methodName, IMethodArgs args) { _logger.Log($"Enter {methodName}"); }
public Exception Catch(string methodName, IMethodArgs args, Exception exception) => exception;
public void Exit(string methodName, IMethodArgs args, IMethodResult result) { _logger.Log($"Exit {methodName}"); }
public MockMethodResponseAsserts(IMethod methodDeclaration, IMethodName methodName, IMethodArgs methodArgs) { _methodDeclaration = methodDeclaration; _methodName = methodName; }
public void Finaly(string methodName, IMethodArgs args, IMethodResult result) { _logger.Log($"Finaly {methodName}"); }
public void Enter(string methodName, IMethodArgs args) { stopwatch = Stopwatch.StartNew(); }
public Exception Catch(string methodName, IMethodArgs args, Exception exception) { _logger.Log($"Catch {methodName}"); return(exception); }
public void Finaly(string methodName, IMethodArgs args, IMethodResult result) { stopwatch.Stop(); }
public void Enter(string methodName, IMethodArgs args) { }
public MockMethodWithParamAndResponseVariable(IMethod methodDeclaration, IInterface theInterface, IMethodArgs methodArgs, IResponseType responseType) : base(methodDeclaration, theInterface) { _methodArgs = methodArgs; _responseType = responseType; }
public MockMethodWithParamVariable(IMethod methodDeclaration, IInterface theInterface, IMethodArgs methodArgs) : base(methodDeclaration, theInterface) => _methodArgs = methodArgs;