Beispiel #1
0
 public FooPropertyInspectorPayload PropertyInspector_SyncResult(FooPropertyInspectorPayload args)
 {
     this.IncrementMethodCallCount(args);
     return(new FooPropertyInspectorPayload
     {
         Source = nameof(PropertyInspector_SyncResult)
     });
 }
Beispiel #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]++;
        }
Beispiel #3
0
        public async Task <FooPropertyInspectorPayload> PropertyInspector_AsyncResult(FooPropertyInspectorPayload args)
        {
            this.IncrementMethodCallCount(args);
            await Task.Delay(1);

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