Ejemplo n.º 1
0
 public FooPropertyInspectorPayload PropertyInspector_SyncResult(FooPropertyInspectorPayload args)
 {
     this.IncrementMethodCallCount(args);
     return(new FooPropertyInspectorPayload
     {
         Source = nameof(PropertyInspector_SyncResult)
     });
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Increments <see cref="MethodCallCount"/> for the specified <paramref name="methodName"/>.
        /// </summary>
        /// <param name="methodName">The name of the method.</param>
        private void IncrementMethodCallCount(FooPropertyInspectorPayload args, [CallerMemberName] string methodName = "")
        {
            // ensure there is a method
            if (string.IsNullOrWhiteSpace(methodName))
            {
                throw new ArgumentException("Argument cannot be null or whitespace", nameof(methodName));
            }

            // add the entry if this is the first call
            if (!this.MethodCallCount.ContainsKey(methodName))
            {
                this.MethodCallCount.Add(methodName, 0);
            }

            this.MethodCallCount[methodName]++;
        }
Ejemplo n.º 3
0
        public async Task <FooPropertyInspectorPayload> PropertyInspector_AsyncResult(FooPropertyInspectorPayload args)
        {
            this.IncrementMethodCallCount(args);
            await Task.Delay(1);

            return(new FooPropertyInspectorPayload
            {
                Source = nameof(PropertyInspector_AsyncResult)
            });
        }
Ejemplo n.º 4
0
 public Task PropertyInspector_AsyncVoid(FooPropertyInspectorPayload args)
 {
     this.IncrementMethodCallCount(args);
     return(Task.CompletedTask);
 }
Ejemplo n.º 5
0
 public void PropertyInspector_SyncVoid(FooPropertyInspectorPayload args)
 => this.IncrementMethodCallCount(args);