public void testTimeOutDetector() { AppDef appDef = new AppDef(); AppState appState = new AppState(); var initialTicks = DateTime.UtcNow.Ticks; IAppInitializedDetector d = new TimeOutInitDetector(appDef, appState, 0, XElement.Parse("<timeout>0.1</timeout>")); Assert.AreEqual(false, d.IsInitialized, "not initialized immediately"); Thread.Sleep(100); Assert.AreEqual(true, d.IsInitialized, "initialized after time out"); }
public void testTimeOutDetectorFailsForInvalidParams() { AppDef appDef = new AppDef(); AppState appState = new AppState(); var d = new TimeOutInitDetector(appDef, appState, 0, XElement.Parse("<timeout>abcd-not-a-double</timeout>")); }