public void RetryHelper(Action action, int ExpectedNum, ref int called) { var Connection = new ServiceBusConnection(new ServiceBusScaleoutOptions("Endpoint=1", "T"), new Logger(), TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(0.1), TimeSpan.FromSeconds(0.1)); Connection.Retry(action); Assert.True(called == ExpectedNum, "Action was called incorrect number of times"); }