void TimerDisposeTest() { timerList = new List <Timer>(); //NUILog.Debug("TimerDisposeTest()!"); for (int i = 0; i < 3; i++) { Timer timer = new Timer(100); if (0 == i) { timer.Tick += Timer_Tick0; } if (1 == i) { timer.Tick += Timer_Tick1; } if (2 == i) { timer.Tick += Timer_Tick2; } timerList.Add(timer); } ////NUILog.Debug($"TimerDisposeTest() dp1 timerlist cnt={timerList.Count}"); foreach (Timer timer in timerList) { timer.Start(); } distest = new DisposeTest(Timer_Tick0); }
public void TryDisposeTest() { var dispose = new DisposeTest(); dispose.TryDispose(); Assert.IsTrue(dispose.IsDisposed); }
static void Main(string[] args) { var diposeTest = new DisposeTest(); var thread = new Thread(diposeTest.Run) { IsBackground = true }; thread.Start(); Thread.Sleep(TimeSpan.FromSeconds(1)); }
public AccountController( IIdentityServerInteractionService interaction, IClientStore clientStore, IAuthenticationSchemeProvider schemeProvider, IEventService events, DisposeTest disposeTest, TestUserStore users = null) { // if the TestUserStore is not in DI, then we'll just use the global users collection // this is where you would plug in your own custom identity management library (e.g. ASP.NET Identity) _users = users ?? new TestUserStore(TestUsers.Users); _interaction = interaction; _clientStore = clientStore; _schemeProvider = schemeProvider; _events = events; disposeTest.ToString(); }