Exemple #1
0
 public CustomVariableGroup SaveGroup(CustomVariableGroup customVariableGroup)
 {
     return(Invoke(() =>
     {
         CustomVariableGroup existingGroup = null;
         if (!string.IsNullOrWhiteSpace(customVariableGroup.Id))
         {
             existingGroup = CustomVariableGroupLogic.GetById(customVariableGroup.Id);
         }
         CustomVariableGroupLogic.Save(customVariableGroup);
         PossiblySendCustomVariableGroupChangedEmail(existingGroup, customVariableGroup);
         return customVariableGroup;
     }));
 }
Exemple #2
0
        public void ApplicationShouldBeInstalledTest_UseCase3()
        {
            // Use Case #3 -- app group exists in the server's ApplicationWithGroupToForceInstallList
            //             -- with *valid* custom variable group

            ApplicationServer appServer = GetAppServerWithInstallationSummariesFromDb();

            // Use this app
            ApplicationWithOverrideVariableGroup appWithValidGroup = appServer.ApplicationsWithOverrideGroup[0];

            appWithValidGroup.CustomVariableGroups[0] = CustomVariableGroupLogic.GetById("CustomVariableGroups/4");

            ApplicationServerLogic.SaveForceInstallation(new ServerForceInstallation(appServer, appWithValidGroup));

            SetGlobalFreeze(false);

            ApplicationServerLogic.InstallApplications(appServer);

            _mockAppInstaller.Verify(x => x.InstallApplication(It.IsAny <ApplicationServer>(),
                                                               It.IsAny <ApplicationWithOverrideVariableGroup>()), Times.Once());
        }
Exemple #3
0
        public void ApplicationShouldBeInstalledTest_UseCase4()
        {
            // Use Case #4 -- app group does not exist in the server's ApplicationWithGroupToForceInstallList

            ApplicationServer appServer = GetAppServerWithInstallationSummariesFromDb();

            // Use this app
            ApplicationWithOverrideVariableGroup appWithValidGroup = appServer.ApplicationsWithOverrideGroup[0];

            appWithValidGroup.CustomVariableGroups[0] = CustomVariableGroupLogic.GetById("CustomVariableGroups/4");

            SetGlobalFreeze(false);

            // Note: We are *not* adding our app to the *force install* list of the server.
            //       In other words, there is no force installation.

            //bool actual = ApplicationServerLogic.ApplicationShouldBeInstalled(appServer, appWithValidGroup);
            //Assert.AreEqual(false, actual);

            ApplicationServerLogic.InstallApplications(appServer);

            _mockAppInstaller.Verify(x => x.InstallApplication(It.IsAny <ApplicationServer>(),
                                                               It.IsAny <ApplicationWithOverrideVariableGroup>()), Times.Never());
        }
Exemple #4
0
 CustomVariableGroup ICustomVariableGroupService.GetById(string id)
 {
     return(Invoke(() => CustomVariableGroupLogic.GetById(id)));
 }