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

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