public async Task DefaultOptionsYieldExpectedDictionarySize() { var eventCount = 0; var itemCount = 0; var proxy = new PerInstanceAdapter <IForTestingPurposes> ( Process.Lean(EventProcessor) ) .Adapt(new ForTestingPurposes()); await proxy.AsyncAction(0, "zero"); Thread.Sleep(1000); Assert.Equal(1, eventCount); Assert.Equal(BitFunctions.CountSet((int)CaptureOptions.Default), itemCount); void EventProcessor(IDictionary <string, object> @event) { eventCount++; itemCount = @event.Count; } }
public async Task AsyncActionInvocationsAreNotCached() { var instance = new ForTestingPurposes(); var proxy = new PerInstanceAdapter <IForTestingPurposes>(For.Ever()).Adapt(instance); await proxy.AsyncAction(0, 1, "two"); Assert.Equal <uint>(1, instance.AsyncActionCallInvocationCount); }