public FooPropertyInspectorPayload PropertyInspector_SyncResult(FooPropertyInspectorPayload args) { this.IncrementMethodCallCount(args); return(new FooPropertyInspectorPayload { Source = nameof(PropertyInspector_SyncResult) }); }
/// <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]++; }
public async Task <FooPropertyInspectorPayload> PropertyInspector_AsyncResult(FooPropertyInspectorPayload args) { this.IncrementMethodCallCount(args); await Task.Delay(1); return(new FooPropertyInspectorPayload { Source = nameof(PropertyInspector_AsyncResult) }); }
public Task PropertyInspector_AsyncVoid(FooPropertyInspectorPayload args) { this.IncrementMethodCallCount(args); return(Task.CompletedTask); }
public void PropertyInspector_SyncVoid(FooPropertyInspectorPayload args) => this.IncrementMethodCallCount(args);