public void ApplicationShouldBeInstalledTest_UseCase5() { // Use Case #5 -- app exists in the server's ApplicationWithGroupToForceInstallList, // but the custom variable is different string rootName = "UseCase05"; TestHelper.CreateAndPersistEntitiesForAUseCase(rootName, 0); ApplicationServer appServer = ApplicationServerLogic.GetByName(TestHelper.GetServerName(rootName)); ApplicationWithOverrideVariableGroup appWithDifferentGroup = new ApplicationWithOverrideVariableGroup(); appWithDifferentGroup.Application = appServer.ApplicationsWithOverrideGroup[0].Application; // Set the group to something that doesn't already exist within the server... appWithDifferentGroup.CustomVariableGroups[0] = TestHelper.CreateCustomVariableGroup(rootName + " " + Guid.NewGuid().ToString()); ApplicationServerLogic.SaveForceInstallation(new ServerForceInstallation(appServer, appWithDifferentGroup)); SetGlobalFreeze(false); ApplicationServerLogic.InstallApplications(appServer); _mockAppInstaller.Verify(x => x.InstallApplication(It.IsAny <ApplicationServer>(), It.IsAny <ApplicationWithOverrideVariableGroup>()), Times.Never()); }
public void ApplicationShouldBeInstalledTest_UseCase6() { // Use Case #6 -- app does not exist in the server's ApplicationWithGroupToForceInstallList, // but the custom variable does. string rootName = "UseCase06"; TestHelper.CreateAndPersistEntitiesForAUseCase(rootName, 0); ApplicationServer appServer = ApplicationServerLogic.GetByName(TestHelper.GetServerName(rootName)); appServer.ApplicationsWithOverrideGroup[0].CustomVariableGroups[0] = TestHelper.CreateCustomVariableGroup(rootName); ApplicationServerLogic.Save(appServer); // To save with a valid group. // Create a new app group with a new app, but an existing group var appWithValidGroup = new ApplicationWithOverrideVariableGroup(); appWithValidGroup.Application = TestHelper.CreateApp(rootName + " " + Guid.NewGuid().ToString()); appWithValidGroup.CustomVariableGroups[0] = appServer.ApplicationsWithOverrideGroup[0].CustomVariableGroups[0]; // Set the app to something that doesn't already exist within the server... // Leave the group alone because it already exists. ApplicationServerLogic.SaveForceInstallation(new ServerForceInstallation(appServer, appWithValidGroup)); SetGlobalFreeze(false); ApplicationServerLogic.InstallApplications(appServer); _mockAppInstaller.Verify(x => x.InstallApplication(It.IsAny <ApplicationServer>(), It.IsAny <ApplicationWithOverrideVariableGroup>()), Times.Never()); }
public void ApplicationShouldBeInstalledTest_UseCase2() { // Use Case #2 -- app group exists in the server's ApplicationWithGroupToForceInstallList // -- with *null* custom variable group ApplicationServer appServer = GetAppServerWithInstallationSummariesFromDb(); // Use this app ApplicationWithOverrideVariableGroup appWithNullGroup = appServer.ApplicationsWithOverrideGroup[0]; ApplicationServerLogic.SaveForceInstallation(new ServerForceInstallation(appServer, appWithNullGroup)); SetGlobalFreeze(false); ApplicationServerLogic.InstallApplications(appServer); _mockAppInstaller.Verify(x => x.InstallApplication(It.IsAny <ApplicationServer>(), It.IsAny <ApplicationWithOverrideVariableGroup>()), Times.Once()); }
public void ApplicationShouldBeInstalledTest_UseCase1() { // Use Case #1 -- app group is not enabled ApplicationServer appServer = GetAppServerWithInstallationSummariesFromDb(); // If disabled, don't install. ApplicationWithOverrideVariableGroup appWithNullGroup = appServer.ApplicationsWithOverrideGroup[0]; appWithNullGroup.Enabled = false; ApplicationServerLogic.SaveForceInstallation(new ServerForceInstallation(appServer, appWithNullGroup)); SetGlobalFreeze(false); ApplicationServerLogic.InstallApplications(appServer); _mockAppInstaller.Verify(x => x.InstallApplication(It.IsAny <ApplicationServer>(), It.IsAny <ApplicationWithOverrideVariableGroup>()), Times.Never()); }