Ejemplo n.º 1
0
        public void testDetectorSingle()
        {
            AppDef appDef = new AppDef();
            AppState appState = new AppState();

            appState.Started = true;
            appState.Running = true;
            IAppInitializedDetector d = new ExitCodeInitDetector(appDef, appState, 0, XElement.Parse("<timeout>1</timeout>"));

            Assert.AreEqual(false, d.IsInitialized, "not initialized immediately");
            appState.Running = false;
            appState.ExitCode = 0;
            Assert.AreEqual(false, d.IsInitialized, "not initialized if wrong exit code");
            appState.ExitCode = 1;
            Assert.AreEqual(true, d.IsInitialized, "initialized if correct exit code");
        }
Ejemplo n.º 2
0
 public void testDetectorFailsOnInvalidParams()
 {
     AppDef appDef = new AppDef();
     AppState appState = new AppState();
     var d = new ExitCodeInitDetector(appDef, appState, 0, XElement.Parse("<timeout>abcd-not-a-double</timeout>"));
 }