Exemple #1
0
        public void ApplicationShouldBeInstalledTest_UseCase12()
        {
            // Use Case #12 -- force installation exists AT THE APP LEVEL, and the force installation time is *after* the most recent
            //                 installation summary time, *installation summaries exist*, and the deployment environments *match*.
            //                 The second test/assert is for when the global setting, FreezeAllInstallations, is true.

            TestEntityContainer container = CreateTestEntityContainer("UseCase12", x => x.InstallationStart.AddSeconds(1), true, false, 5);

            bool actual = ApplicationServerLogic.ApplicationShouldBeInstalled(container.ApplicationServer, container.AppWithGroup);

            Assert.AreEqual(true, actual);  // True because an installation has not yet occurred after the force deployment time.

            /*************************************************************************************
            * Now try it with FreezeAllInstallations true to override any installation logic.
            *************************************************************************************/

            SetGlobalFreeze(true);

            //bool actualUsingFreeze = ApplicationServerLogic.ApplicationShouldBeInstalled(container.ApplicationServer, container.AppWithGroup);
            //Assert.AreEqual(false, actualUsingFreeze);  // False because FreezeAllInstallations is true.

            ApplicationServerLogic.InstallApplications(container.ApplicationServer);

            _mockAppInstaller.Verify(x => x.InstallApplication(It.IsAny <ApplicationServer>(),
                                                               It.IsAny <ApplicationWithOverrideVariableGroup>()), Times.Never());
        }