/// <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; }
public void Remove_CannotRemoveDomainFromEmptyCollection() { ServiceAppProcessCollection collection = new ServiceAppProcessCollection(new ServiceAppProcessComparer()); ServiceAppProcess saProc = _serviceAppProcessFactory.CreateServiceAppProcess(null, null); bool success = collection.Remove(saProc); Assert.IsFalse(success); }
public void Add_CanInsertUniqueDomainToCollection() { ServiceAppProcessCollection collection = new ServiceAppProcessCollection(new ServiceAppProcessComparer()); ServiceAppProcess saProc = _serviceAppProcessFactory.CreateServiceAppProcess(null, null); collection.Add(saProc); Assert.AreEqual(1, collection.Count); }
public void GetIndex_CanReturnServiceAppProcessFromCollectionUsingString() { ServiceAppProcessCollection collection = new ServiceAppProcessCollection(new ServiceAppProcessComparer()); ServiceAppProcess saProc = _serviceAppProcessFactory.CreateServiceAppProcess(null, null); collection.Add(saProc); Assert.AreEqual(saProc, collection["__Test"]); }
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); }
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); } }