Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AppManager"/> class.
 /// </summary>
 /// <param name="serviceAppFactory">The factory that creates <see cref="ServiceAppProcess"/>.</param>
 /// <param name="schedulingService">The scheduling service.</param>
 /// <param name="emailer">The email provider.</param>
 /// <param name="daoFactory">The DAO factory.</param>
 public AppManager(IServiceAppProcessFactory serviceAppFactory, IServiceAppSchedulingService schedulingService, EmailProvider emailer, IDaoFactory daoFactory)
 {
     _ServiceAppProcesses = new ServiceAppProcessCollection(new ServiceAppProcessComparer());
     _serviceAppFactory   = serviceAppFactory;
     _schedulingService   = schedulingService;
     _emailer             = emailer;
     _daoFactory          = daoFactory;
 }
Пример #2
0
        public void Remove_CannotRemoveDomainFromEmptyCollection()
        {
            ServiceAppProcessCollection collection = new ServiceAppProcessCollection(new ServiceAppProcessComparer());
            ServiceAppProcess           saProc     = _serviceAppProcessFactory.CreateServiceAppProcess(null, null);

            bool success = collection.Remove(saProc);

            Assert.IsFalse(success);
        }
Пример #3
0
        public void Add_CanInsertUniqueDomainToCollection()
        {
            ServiceAppProcessCollection collection = new ServiceAppProcessCollection(new ServiceAppProcessComparer());
            ServiceAppProcess           saProc     = _serviceAppProcessFactory.CreateServiceAppProcess(null, null);

            collection.Add(saProc);

            Assert.AreEqual(1, collection.Count);
        }
Пример #4
0
        public void GetIndex_CanReturnServiceAppProcessFromCollectionUsingString()
        {
            ServiceAppProcessCollection collection = new ServiceAppProcessCollection(new ServiceAppProcessComparer());
            ServiceAppProcess           saProc     = _serviceAppProcessFactory.CreateServiceAppProcess(null, null);

            collection.Add(saProc);

            Assert.AreEqual(saProc, collection["__Test"]);
        }
Пример #5
0
        public void Remove_CanRemoveInstalledDomainFromCollection()
        {
            ServiceAppProcessCollection collection = new ServiceAppProcessCollection(new ServiceAppProcessComparer());
            ServiceAppProcess           saProc     = _serviceAppProcessFactory.CreateServiceAppProcess(null, null);

            collection.Add(saProc);

            bool success = collection.Remove(saProc);

            Assert.IsTrue(success);
        }
Пример #6
0
        public void Add_CannotAddDuplicateDomainToCollection()
        {
            ServiceAppProcessCollection collection = new ServiceAppProcessCollection(new ServiceAppProcessComparer());
            ServiceAppProcess           saProc1    = _serviceAppProcessFactory.CreateServiceAppProcess(null, null);
            ServiceAppProcess           saProc2    = _serviceAppProcessFactory.CreateServiceAppProcess(null, null);

            collection.Add(saProc1);

            try
            {
                collection.Add(saProc2);
                Assert.Fail("Able to add duplicate domain.");
            }
            catch (AssertionException)
            {
                throw;
            }
            catch
            {
                Assert.AreEqual(1, collection.Count);
            }
        }