public void AddArea_passingInProjectDetailsWithThreeLevelsOfAreasAllCompletelyNew_AreaGoesUpByOneOnTopLevelAndTwoLevelsDownAreCreated() { // arrange ProjectDetail projectDetail = TestConstants.TfsTeamProjectDetail; List <ProjectArea> initialList; List <ProjectArea> finalList; bool fullExpectedPathExists = false; using (IAreaManager manager = AreaManagerFactory.GetManager(projectDetail)) { initialList = manager.ListAreas(); string newAreaName = "Top Level " + GetRandomGuid() + "\\Level Two\\Level Three"; // act manager.AddNewArea(newAreaName); // assert finalList = manager.ListAreas(); fullExpectedPathExists = manager.CheckIfPathAlreadyExists(newAreaName); } int expectedRoot = initialList.Count + 1; int actualRoot = finalList.Count; // check root level Area count Assert.AreEqual(expectedRoot, actualRoot); // check newly added top level node has 1 child and that child has 1 child Assert.IsTrue(fullExpectedPathExists); }
public void AddArea_passingInProjectDetailsWithTwoLevelsOfAreas_AreaCountStaysTheSameButTheChildAreaCountOfTheFirstAreaGoesUpByOne() { // arrange ProjectDetail projectDetail = TestConstants.TfsTeamProjectDetail; List <ProjectArea> initialList; ProjectArea initialFirstArea; List <ProjectArea> finalList; ProjectArea finalFirstArea; using (IAreaManager manager = AreaManagerFactory.GetManager(projectDetail)) { initialList = manager.ListAreas(); initialFirstArea = initialList[0]; string newAreaName = initialFirstArea.Name + "\\Area " + GetRandomGuid(); // act manager.AddNewArea(newAreaName); // assert finalList = manager.ListAreas(); finalFirstArea = finalList[0]; } int expectedRoot = initialList.Count; int actualRoot = finalList.Count; // check root level Area count Assert.AreEqual(expectedRoot, actualRoot); int expectedChild = initialFirstArea.Children.Count + 1; int actualChild = finalFirstArea.Children.Count; // check child level Area count Assert.AreEqual(expectedChild, actualChild); }
private void LoadAreaPaths() { AreaPaths = new List <ProjectArea>(); IAreaManager areaManager = AreaManagerFactory.GetManager(ProjectDetails, tfsCredentials); AreaPaths.AddRange(areaManager.FlattenAreas(areaManager.ListAreas()).Where(o => ReadTeamAreaPaths().Contains(o.FullPath))); }
private void AddAreaAndCheckEnabledOnBacklog(string teamName, bool enableForTeam) { // arrange ProjectDetail projectDetail = TestConstants.TfsTeamProjectDetail; List <ProjectArea> initialList; List <ProjectArea> finalList; string newAreaName = null; IAreaManager manager = AreaManagerFactory.GetManager(projectDetail); ITeamManager teamManager = TeamManagerFactory.GetManager(projectDetail); initialList = manager.ListAreas(); newAreaName = "Area " + GetRandomGuid(); // act manager.AddNewArea(newAreaName, new List <ITfsTeam> { enableForTeam?teamManager.GetTfsTeam(teamName) : null }); // assert finalList = manager.ListAreas(); int expected = initialList.Count + 1; int actual = finalList.Count; Assert.AreEqual(expected, actual); ProjectArea addedItem = (from o in finalList where o.Name == newAreaName select o).FirstOrDefault(); Assert.IsNotNull(addedItem); Assert.AreEqual(enableForTeam, teamManager.GetTfsTeam(teamName).IsAreaPathEnabled(newAreaName)); }
public ListHelper(IAreaManager areaManager, IGoalManager goalManager, IMetricManager metricManager, IExternalApiAuthManager externalApiAuthManager) { _areaManager = areaManager; _goalManager = goalManager; _metricManager = metricManager; _externalApiAuthManager = externalApiAuthManager; }
public void DeleteArea_passInNull_ArgumentNullException() { // arrange ProjectDetail projectDetail = TestConstants.TfsTeamProjectDetail; IAreaManager manager = AreaManagerFactory.GetManager(projectDetail); // act manager.DeleteArea(null); // assert }
public void Ctor_passingInProjectDetails_InstanceOfAreaManager() { // arrange ProjectDetail projectDetail = TestConstants.TfsTeamProjectDetail; // act IAreaManager manager = AreaManagerFactory.GetManager(projectDetail); // assert Assert.IsInstanceOfType(manager, typeof(IAreaManager)); }
private int AddArea(IAreaManager manager, out string areaPath) { int notExpected = manager.ListAreas().Count; areaPath = GetRandomGuid(); manager.AddNewArea(areaPath); int actual = manager.ListAreas().Count; Assert.AreNotEqual(notExpected, actual, "Adding an Area to delete returned unexpected count"); return(notExpected); }
public void DeleteAreaUsingAreaPath_passInAInValidAreaPath_ExceptionExpected() { // arrange ProjectDetail projectDetail = TestConstants.TfsTeamProjectDetail; IAreaManager manager = AreaManagerFactory.GetManager(projectDetail); // act manager.DeleteAreaUsingAreaPath(GetRandomGuid()); // assert }
public AccountController(IUserManager userManager, IMobileManager mobileManager, IClassesManager classesManager, ITradeManager tradeManager, IAreaManager areaManager) { _UserManager = userManager; _MobileManager = mobileManager; _ClassesManager = classesManager; _TradeManager = tradeManager; _AreaManager = areaManager; }
public void ListAreas_passingInProjectDetails_InstanceOfListOfAreas() { // arrange ProjectDetail projectDetail = TestConstants.TfsTeamProjectDetail; IAreaManager manager = AreaManagerFactory.GetManager(projectDetail); // act List <ProjectArea> list = manager.ListAreas(); // assert Assert.IsInstanceOfType(list, typeof(List <ProjectArea>)); }
public AreaViewModel(IMessageBoxService messageBoxService, Area area, IAreaManager manager) : base(messageBoxService, area, manager) { // do initialization try { this.DisplayName = "Edit Area: " + this.Item.Name; } catch (Exception ex) { this.MessageBoxService.ShowError(this.GetType().FullName + System.Reflection.MethodBase.GetCurrentMethod().Name + ": " + ex.Message); } }
public void AddArea_passingInProjectDetailsWithThreeLevelsOfAreas_AreaCountStaysTheSameButTheChildOfChildAreaCountOfTheFirstAreaGoesUpByOne() { // arrange ProjectDetail projectDetail = TestConstants.TfsTeamProjectDetail; List <ProjectArea> initialList; ProjectArea initialFirstArea; List <ProjectArea> finalList; ProjectArea finalFirstArea; using (IAreaManager manager = AreaManagerFactory.GetManager(projectDetail)) { initialList = manager.ListAreas(); if (initialList.Count == 0) { Assert.Fail("No Areas found yet to add a duplication of"); } ProjectArea[] listOfAreas = initialList.Where(o => o.Children.Count > 0).ToArray(); if (listOfAreas.Length == 0) { Assert.Fail("No Areas found in the first interation yet to add a duplication of"); } listOfAreas = listOfAreas.Where(o => o.Children.Count > 0).ToArray(); if (listOfAreas.Length == 0) { Assert.Fail("The first interation has no children yet to add a duplication of"); } ProjectArea firstArea = listOfAreas[0]; initialFirstArea = firstArea.Children[0]; string newAreaName = firstArea.Name + "\\" + initialFirstArea.Name + "\\Area " + GetRandomGuid(); // act manager.AddNewArea(newAreaName); // assert finalList = manager.ListAreas(); listOfAreas = finalList.Where(o => o.Children.Count > 0).ToArray(); listOfAreas = listOfAreas.Where(o => o.Children.Count > 0).ToArray(); finalFirstArea = listOfAreas[0].Children[0]; } int expectedRoot = initialList.Count; int actualRoot = finalList.Count; // check root level Area count Assert.AreEqual(expectedRoot, actualRoot); int expectedChild = initialFirstArea.Children.Count + 1; int actualChild = finalFirstArea.Children.Count; // check child level Area count Assert.AreEqual(expectedChild, actualChild); }
public void IsAreaPathVisibleForAreaPlanning_passingInWrongPath_ReturnFalse() { // arrange ProjectDetail projectDetail = TestConstants.TfsTeamProjectDetail; IAreaManager manager = AreaManagerFactory.GetManager(projectDetail); bool actual = false; // act actual = manager.IsAreaPathEnabled(TestConstants.TfsTeam, GetRandomGuid()); // assert Assert.IsFalse(actual); }
public FootballImportService(IFootballImporter footballImporter, IAreaManager areaManager, ILeagueManager leagueManager, ITeamManager teamManager, IMatchManager matchManager) { _footballImporter = footballImporter; _areaManager = areaManager; _leagueManager = leagueManager; _teamManager = teamManager; _matchManager = matchManager; }
public void EnableDisableAreaPath_passingInNewPath_ShouldEnablePathAndThenDisablePath() { // arrange ProjectDetail projectDetail = TestConstants.TfsTeamProjectDetail; IAreaManager manager = AreaManagerFactory.GetManager(projectDetail); string newAreaName = GetRandomGuid(); manager.AddNewArea(newAreaName); manager.EnableAreaPath(TestConstants.TfsTeam, newAreaName, true); Assert.IsTrue(manager.IsAreaPathEnabled(TestConstants.TfsTeam, newAreaName), "Area path did not enable for team."); manager.DisableAreaPath(TestConstants.TfsTeam, newAreaName); Assert.IsFalse(manager.IsAreaPathEnabled(TestConstants.TfsTeam, newAreaName), "Area path did not disable for team."); }
public void Ctor_disposeOfObject_NoErrorThrown() { // arrange ProjectDetail projectDetail = TestConstants.TfsTeamProjectDetail; // act using (IAreaManager manager = AreaManagerFactory.GetManager(projectDetail)) { manager.Dispose(); } // assert Assert.IsTrue(1 == 1); }
public void AddArea_passingInProjectDetailsAndAnExistingAreaName_ExceptionThrown() { // arrange ProjectDetail projectDetail = TestConstants.TfsTeamProjectDetail; using (IAreaManager manager = AreaManagerFactory.GetManager(projectDetail)) { string newAreaName = GetRandomGuid() + " Area"; manager.AddNewArea(newAreaName); // act manager.AddNewArea(newAreaName); } }
public void DeleteAreaUsingAreaPath_passInAValidAreaPath_ListAreasReturnLess1ThanBeforeDelele() { // arrange ProjectDetail projectDetail = TestConstants.TfsTeamProjectDetail; IAreaManager manager = AreaManagerFactory.GetManager(projectDetail); string AreaPath; int expected = this.AddArea(manager, out AreaPath); // act manager.DeleteAreaUsingAreaPath(AreaPath); // assert int actual = manager.ListAreas().Count; Assert.AreEqual(expected, actual); }
public void IsAreaPathVisibleForAreaPlanning_passingInCorrectPath_ReturnTrue() { // arrange ProjectDetail projectDetail = TestConstants.TfsTeamProjectDetail; IAreaManager manager = AreaManagerFactory.GetManager(projectDetail); string newAreaName = GetRandomGuid(); manager.AddNewArea(newAreaName); bool actual = false; // act actual = manager.IsAreaPathEnabled(TestConstants.TfsTeam, newAreaName); // assert Assert.IsFalse(actual); }
public ReportsController(IReportManager reportManager, IMetricManager metricManager, IReportGoalManager reportGoalManager, ICompanyManager companyManager, IReportAreaManager reportAreaManager, ListHelper listHelper, IRecipientManager recipientManager, IReportEmailManager reportEmailManager, IAreaManager areaManager, IReportAttachmentManager reportAttachmentManager, ISubscriptionManager subscriptionManager, IWebhookManager webhookManager) { _reportManager = reportManager; _metricManager = metricManager; _companyManager = companyManager; ListHelper = listHelper; _reportGoalManager = reportGoalManager; _reportAreaManager = reportAreaManager; _recipientManager = recipientManager; _reportEmailManager = reportEmailManager; _areaManager = areaManager; _reportAttachmentManager = reportAttachmentManager; _subscriptionManager = subscriptionManager; _webhookManager = webhookManager; }
public TableViewModel(IMessageBoxService messageBoxService, Table table, ITableManager manager, IAreaManager areaManager) : base(messageBoxService, table, manager) { // do initialization try { if (areaManager == null) { throw new ArgumentNullException("areaManager"); } _areaManager = areaManager; // populate the list of areas this.AreaList = _areaManager.GetList(); this.DisplayName = "Edit Table: " + this.Item.Name; } catch (Exception ex) { this.MessageBoxService.ShowError(this.GetType().FullName + System.Reflection.MethodBase.GetCurrentMethod().Name + ": " + ex.Message); } }
public TablesManagementViewModel(IMessageBoxService messageBoxService, IUIVisualizerService uiVisualizerService, ITableManager tableManager, IAreaManager areaManager) : base(messageBoxService, uiVisualizerService, tableManager) { // do initialization try { if (areaManager == null) { throw new ArgumentNullException("areaManager"); } _areaManager = areaManager; // get list this.DisplayName = "Tables Management"; this.Items = new System.Collections.ObjectModel.ObservableCollection <Table>(GetItems()); AreaListViewModel = new AreaListViewModel(this.MessageBoxService, this.UIVisualizerService, _areaManager); } catch (Exception ex) { this.MessageBoxService.ShowError(this.GetType().FullName + System.Reflection.MethodBase.GetCurrentMethod().Name + ": " + ex.Message); } }
public void AddArea_passingInProjectDetails_AreaCountGoesUpByOne() { // arrange ProjectDetail projectDetail = TestConstants.TfsTeamProjectDetail; List <ProjectArea> initialList; List <ProjectArea> finalList; IAreaManager manager = AreaManagerFactory.GetManager(projectDetail); initialList = manager.ListAreas(); string newAreaName = "Area " + GetRandomGuid(); // act manager.AddNewArea(newAreaName); // assert finalList = manager.ListAreas(); int expected = initialList.Count + 1; int actual = finalList.Count; Assert.AreEqual(expected, actual); manager.Dispose(); }
public ReportingAreasController(IAreaManager areaManager, ListHelper listHelper) { _areaManager = areaManager; ListHelper = listHelper; }
public AreaController(IAreaManager areaManager) { _AreaManager = areaManager; }
public AreaController(IAreaManager areaManager, IValidatorFactory validatorFactory) { this.areaManager = areaManager; this.validatorFactory = validatorFactory; }
public CommonDataController(IClassesManager classesManager, ITradeManager tradeManager, IAreaManager areaManager) { _ClassesManager = classesManager; _TradeManager = tradeManager; _AreaManager = areaManager; }
public EmployeeRegisterManager(IAreaManager areaManager, IEmployeeManager employeeManager) { _areaManager = areaManager; _employeeManager = employeeManager; }
public UserController(IUserManager userManager, IAreaManager areaManager, IClassesManager classManager) { _UserManager = userManager; _AreaManager = areaManager; _ClassManager = classManager; }
public AreasController(IAreaManager areaManager) { _areaManager = areaManager; }
public CommonDataController(IClassesManager classesManager,ITradeManager tradeManager,IAreaManager areaManager) { _ClassesManager = classesManager; _TradeManager = tradeManager; _AreaManager = areaManager; }
private int AddArea(IAreaManager manager, out string areaPath) { int notExpected = manager.ListAreas().Count; areaPath = GetRandomGuid(); manager.AddNewArea(areaPath); int actual = manager.ListAreas().Count; Assert.AreNotEqual(notExpected, actual, "Adding an Area to delete returned unexpected count"); return notExpected; }