Example #1
0
 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;
        }
Example #3
0
 public void Enter(string methodName, IMethodArgs args)
 {
     foreach (var visitor in _visitors)
     {
         visitor.Enter(methodName, args);
     }
 }
Example #4
0
        public Exception Catch(string methodName, IMethodArgs args, Exception exception)
        {
            foreach (var visitor in _visitors)
            {
                exception = visitor.Catch(methodName, args, exception);
            }

            return(exception);
        }
Example #5
0
        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);
        }
Example #6
0
        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)
 {
 }
Example #10
0
 public Exception Catch(string methodName, IMethodArgs args, Exception exception)
 {
     _logger.Log($"Failed method {methodName}. Total time: {stopwatch.ElapsedMilliseconds} ms");
     return(exception);
 }
Example #11
0
 public void Exit(string methodName, IMethodArgs args, IMethodResult result)
 {
     _logger.Log($"Successful method {methodName}. Total time: {stopwatch.ElapsedMilliseconds} ms");
 }
Example #12
0
 public MockMethodParamAsserts(IMethod methodDeclaration, IMethodName methodName, IMethodArgs methodArgs)
 {
     _methodDeclaration = methodDeclaration;
     _methodName        = methodName;
     _methodArgs        = methodArgs;
 }
Example #13
0
 public void Enter(string methodName, IMethodArgs args)
 {
     _logger.Log($"Enter {methodName}");
 }
 public Exception Catch(string methodName, IMethodArgs args, Exception exception) => exception;
Example #15
0
 public void Exit(string methodName, IMethodArgs args, IMethodResult result)
 {
     _logger.Log($"Exit {methodName}");
 }
Example #16
0
 public MockMethodResponseAsserts(IMethod methodDeclaration, IMethodName methodName, IMethodArgs methodArgs)
 {
     _methodDeclaration = methodDeclaration;
     _methodName        = methodName;
 }
Example #17
0
 public void Finaly(string methodName, IMethodArgs args, IMethodResult result)
 {
     _logger.Log($"Finaly {methodName}");
 }
Example #18
0
 public void Enter(string methodName, IMethodArgs args)
 {
     stopwatch = Stopwatch.StartNew();
 }
Example #19
0
 public Exception Catch(string methodName, IMethodArgs args, Exception exception)
 {
     _logger.Log($"Catch {methodName}");
     return(exception);
 }
Example #20
0
 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;