Esempio n. 1
0
        internal static int Add_TestResolutionStates(
            Excel.XlLocation insertAt,
            Options_AZDO_TFS options,
            ITestManagementTeamProject testManagementTeamProject)
        {
            Int64 startTicks = Log.APPLICATION("Enter", Common.LOG_CATEGORY);

            int itemCount = 0;

            IEnumerable <ITestResolutionState> testResolutionStates = testManagementTeamProject.TestResolutionStates.Query();
            int totalItems = testResolutionStates.Count();

            XlHlp.DisplayInWatchWindow($"Processing ({ totalItems } testResolutionStates");

            foreach (ITestResolutionState testResolutionState in testManagementTeamProject.TestResolutionStates.Query())
            {
                insertAt.ClearOffsets();

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), testManagementTeamProject.TeamProjectName);

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testResolutionState.Id}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testResolutionState.Name}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testResolutionState.Project.TeamProjectName}");

                insertAt.IncrementRows();
                itemCount++;

                //ProcessItemDelay(options);
                AZDOHelper.DisplayLoopUpdates(startTicks, options, totalItems, itemCount);
            }

            Log.APPLICATION("Exit", Common.LOG_CATEGORY, startTicks);

            return(itemCount);
        }
Esempio n. 2
0
        private XlHlp.XlLocation DisplayListOf_ContentTypes(XlHlp.XlLocation insertAt, ContentTypeCollection contentTypes, bool displayDataOnly, string tableSuffix)
        {
            long startTicks = XlHlp.DisplayInWatchWindow(insertAt);

            Worksheet ws = insertAt.workSheet;

            if (!displayDataOnly)
            {
                insertAt.MarkStart(XlHlp.MarkType.GroupTable);

                XlHlp.AddColumnHeaderToSheetX(insertAt.AddOffsetColumnX(), 40, "Name");
                XlHlp.AddColumnHeaderToSheetX(insertAt.AddOffsetColumnX(), 30, "Group");
                XlHlp.AddColumnHeaderToSheetX(insertAt.AddOffsetColumnX(), 15, "Id");
                XlHlp.AddColumnHeaderToSheetX(insertAt.AddOffsetColumnX(), 20, "SchemaXml");

                insertAt.IncrementRows();
            }

            foreach (var cType in contentTypes)
            {
                insertAt.ClearOffsets();

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), cType.Name);
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), cType.Group);
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), cType.Id.ToString());
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), cType.SchemaXml);

                insertAt.IncrementRows();
            }

            XlHlp.DisplayInWatchWindow(insertAt, startTicks, "End");

            return(insertAt);
        }
Esempio n. 3
0
        private VNC.AddinHelper.Excel.XlLocation DisplayListOf_Lists(VNC.AddinHelper.Excel.XlLocation insertAt, IEnumerable <List> lists, bool displayDataOnly, string tableSuffix)
        {
            long startTicks = XlHlp.DisplayInWatchWindow(insertAt);

            Worksheet ws = insertAt.workSheet;

            if (!displayDataOnly)
            {
                insertAt.MarkStart(XlHlp.MarkType.GroupTable);

                XlHlp.AddColumnHeaderToSheetX(insertAt.AddOffsetColumnX(), 40, "Title");
                XlHlp.AddColumnHeaderToSheetX(insertAt.AddOffsetColumnX(), 15, "Id");
                XlHlp.AddColumnHeaderToSheetX(insertAt.AddOffsetColumnX(), 20, "SchemaXml");

                insertAt.IncrementRows();
            }

            foreach (var list in lists)
            {
                insertAt.ClearOffsets();

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), list.Title);
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), list.Id.ToString());
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), list.SchemaXml);

                insertAt.IncrementRows();
            }

            XlHlp.DisplayInWatchWindow(insertAt, startTicks, "End");

            return(insertAt);
        }
Esempio n. 4
0
        //private static IEnumerable<List> Get_Lists(ClientContext ctx, Web web)
        //{
        //    var alllists = web.Lists;

        //    IEnumerable<List> lists = ctx.LoadQuery(alllists.Where
        //        (list => list.BaseType == BaseType.GenericList)
        //        );

        //    ctx.ExecuteQuery();
        //    return lists;
        //}

        private XlHlp.XlLocation AddSection_Lists(XlHlp.XlLocation insertAt, ClientContext ctx, Web web)
        {
            long startTicks = XlHlp.DisplayInWatchWindow(insertAt);

            if (insertAt.OrientVertical)
            {
                XlHlp.AddLabeledInfoX(insertAt.AddRowX(), "Lists", web.Title);
            }
            else
            {
                XlHlp.AddLabeledInfoX(insertAt.AddRowX(), "Lists", web.Title, orientation: XlOrientation.xlUpward);
                insertAt.IncrementColumns();
            }

            IEnumerable <List> lists = VNCSP.Helper.GetLists(ctx, web);

            insertAt.MarkStart(XlHlp.MarkType.GroupTable);

            insertAt = DisplayListOf_Lists(insertAt, lists, false, "OneLevel");

            insertAt.MarkEnd(XlHlp.MarkType.GroupTable, string.Format("tblLists_{0}", web.Title));

            insertAt.Group(insertAt.OrientVertical, hide: true);

            insertAt.EndSectionAndSetNextLocation(insertAt.OrientVertical);

            XlHlp.DisplayInWatchWindow(insertAt, startTicks, "End");

            return(insertAt);
        }
Esempio n. 5
0
        internal static int Add_Queries(
            Excel.XlLocation insertAt,
            Options_AZDO_TFS options,
            ITestManagementTeamProject testManagementTeamProject)
        {
            Int64 startTicks = Log.APPLICATION("Enter", Common.LOG_CATEGORY);

            int itemCount  = 0;
            int totalItems = testManagementTeamProject.Queries.Count;

            XlHlp.DisplayInWatchWindow($"Processing ({ totalItems } Queries");

            foreach (ITestCaseQuery query in testManagementTeamProject.Queries)
            {
                insertAt.ClearOffsets();

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), testManagementTeamProject.TeamProjectName);

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), query.Name);
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), query.Owner);
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), query.QueryText);

                insertAt.IncrementRows();
                itemCount++;

                AZDOHelper.ProcessItemDelay(options);
                AZDOHelper.DisplayLoopUpdates(startTicks, options, totalItems, itemCount);
            }

            Log.APPLICATION("Exit", Common.LOG_CATEGORY, startTicks);

            return(itemCount);
        }
Esempio n. 6
0
        private void CreateWS_Web_Info(ClientContext ctx, string sectionsToDisplay, bool orientVertical)
        {
            XlHlp.DisplayInWatchWindow(string.Format("{0}",
                                                     System.Reflection.MethodInfo.GetCurrentMethod().Name));

            var web = ctx.Web;

            ctx.Load(web);
            ctx.ExecuteQuery();

            string    sheetName = XlHlp.SafeSheetName(string.Format("{0}{1}", "SPWeb>", web.Title));
            Worksheet ws        = XlHlp.NewWorksheet(sheetName, beforeSheetName: "FIRST");

            XlHlp.XlLocation insertAt = new XlHlp.XlLocation(ws, row: 2, column: 1, orientVertical: GetDisplayOrientation());

            if (insertAt.OrientVertical)
            {
                XlHlp.AddContentToCell(insertAt.AddRowX(), "Web Info");
                insertAt.IncrementRows();
            }
            else
            {
                XlHlp.AddContentToCell(insertAt.AddRowX(), "Web Info");
                insertAt.DecrementRows();   // AddRow bumped it.
                insertAt.IncrementColumns();
            }

            if (sectionsToDisplay.Contains("WebInfo"))
            {
                insertAt = AddSection_WebInfo(insertAt, ctx, web).IncrementPosition(insertAt.OrientVertical);
            }

            if (sectionsToDisplay.Contains("Libraries"))
            {
                insertAt = AddSection_Libraries(insertAt, ctx, web).IncrementPosition(insertAt.OrientVertical);
            }

            if (sectionsToDisplay.Contains("Lists"))
            {
                insertAt = AddSection_Lists(insertAt, ctx, web).IncrementPosition(insertAt.OrientVertical);
            }

            if (sectionsToDisplay.Contains("SiteGroups"))
            {
                insertAt = AddSection_SiteGroups(insertAt, ctx, web).IncrementPosition(insertAt.OrientVertical);
            }

            if (sectionsToDisplay.Contains("SiteColumns"))
            {
                insertAt = AddSection_SiteColumns(insertAt, ctx, web).IncrementPosition(insertAt.OrientVertical);
            }

            if (sectionsToDisplay.Contains("ContentTypes"))
            {
                insertAt = AddSection_ContentTypes(insertAt, ctx, web).IncrementPosition(insertAt.OrientVertical);
            }
        }
Esempio n. 7
0
        private XlHlp.XlLocation AddSection_SiteGroups(XlHlp.XlLocation insertAt, ClientContext ctx, Web web)
        {
            long startTicks = XlHlp.DisplayInWatchWindow(insertAt);

            //XlHlp.AddTitledInfo(ws.Cells[startingRow++, 1], "Groups", "SiteName");

            //Range rng = ws.Cells[startingRow, 1];
            //int rowsAdded = 0;

            //var siteGroups = web.SiteGroups;

            ////IEnumerable<List> groups = ctx.LoadQuery(siteGroups.Where(true));

            //ctx.Load(siteGroups);

            //ctx.ExecuteQuery();

            //foreach (var group in siteGroups)
            //{
            //    int col = 0;
            //    //XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], group.LoginName); // Seems same as Title
            //    XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], group.Title);
            //    XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], group.Id.ToString());
            //    //XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], group.Owner.LoginName);
            //    XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], group.PrincipalType.ToString());

            //    rowsAdded++;

            //    UserCollection users = ctx.Web.SiteGroups.GetById(group.Id).Users;

            //    ctx.Load(users);
            //    ctx.ExecuteQuery();

            //    foreach (var user in users)
            //    {
            //        col = 4;
            //        //XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], user.LoginName);
            //        XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], user.Title);
            //        XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], user.Id.ToString());
            //        //XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], user.UserId.ToString());
            //        XlHlp.AddContentToCell(rng.Offset[rowsAdded, col++], user.PrincipalType.ToString());
            //        rowsAdded++;
            //    }
            //    rowsAdded++;

            //}

            //insertAt.MarkEnd(XlHlp.MarkType.GroupTable, string.Format("tblSiteGroups_{0}", web.Title));

            //insertAt.Group(insertAt.OrientVertical, hide: true);

            //insertAt.EndSectionAndSetNextLocation(insertAt.OrientVertical);

            XlHlp.DisplayInWatchWindow(insertAt, startTicks, "End");

            return(insertAt);
        }
Esempio n. 8
0
        internal static int Add_TestVariables(
            Excel.XlLocation insertAt,
            Options_AZDO_TFS options,
            ITestManagementTeamProject testManagementTeamProject)
        {
            Int64 startTicks = Log.APPLICATION("Enter", Common.LOG_CATEGORY);

            int itemCount = 0;

            string query = String.Format(
                "SELECT *"
                + " FROM TestVariable");

            IEnumerable <ITestVariable> testVariables = testManagementTeamProject.TestVariables.Query();
            int totalItems = testVariables.Count();

            XlHlp.DisplayInWatchWindow($"Processing ({ totalItems } testVariables");

            foreach (ITestVariable testVariable in testVariables)
            {
                insertAt.ClearOffsets();

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testManagementTeamProject.TeamProjectName}");

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testVariable.Id}");

                StringBuilder allowedValues = new StringBuilder();

                foreach (var item in testVariable.AllowedValues)
                {
                    if (allowedValues.Length == 0)
                    {
                        allowedValues.Append($"{item.Value}");
                    }
                    else
                    {
                        allowedValues.Append($"; {item.Value}");
                    }
                }

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{allowedValues}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testVariable.Description}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testVariable.Name}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testVariable.Revision}");

                insertAt.IncrementRows();
                itemCount++;

                AZDOHelper.ProcessItemDelay(options);
                AZDOHelper.DisplayLoopUpdates(startTicks, options, totalItems, itemCount);
            }

            Log.APPLICATION("Exit", Common.LOG_CATEGORY, startTicks);

            return(itemCount);
        }
Esempio n. 9
0
        internal static int Add_TestSuites(
            Excel.XlLocation insertAt,
            Options_AZDO_TFS options,
            ITestManagementTeamProject testManagementTeamProject)
        {
            Int64 startTicks = Log.APPLICATION("Enter", Common.LOG_CATEGORY);

            int itemCount = 0;

            //string query = String.Format(
            //    "SELECT [System.Id], [System.Title]"
            //    + " FROM WorkItems"
            //    + " WHERE [System.WorkItemType] = 'Test Suite'"
            //    + " AND [Team Project] = '{0}'", testManagementTeamProject.TeamProjectName);

            string query = String.Format(
                "SELECT *"
                + " FROM TestSuite"
                );

            ITestSuiteCollection testSuites = testManagementTeamProject.TestSuites.Query(query);
            int totalItems = testSuites.Count;

            XlHlp.DisplayInWatchWindow($"Processing ({ totalItems } testSuites");

            foreach (var testSuite in testSuites)
            {
                insertAt.ClearOffsets();

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testManagementTeamProject.TeamProjectName}");

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSuite.Id}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSuite.Title}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSuite.Description}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSuite.State}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSuite.LastUpdated}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSuite.LastUpdatedByName}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSuite.TestCaseCount}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSuite.TestSuiteType}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSuite.AllTestCases.Count}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSuite.Revision}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSuite.Plan.Id}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSuite.Plan.Name}");

                insertAt.IncrementRows();
                itemCount++;

                AZDOHelper.ProcessItemDelay(options);
                AZDOHelper.DisplayLoopUpdates(startTicks, options, totalItems, itemCount);
            }

            Log.APPLICATION("Exit", Common.LOG_CATEGORY, startTicks);

            return(itemCount);
        }
Esempio n. 10
0
        internal static int Add_TestResults(
            Excel.XlLocation insertAt,
            Options_AZDO_TFS options,
            ITestManagementTeamProject testManagementTeamProject)
        {
            Int64 startTicks = Log.APPLICATION("Enter", Common.LOG_CATEGORY);

            int itemCount = 0;

            string query = String.Format(
                "SELECT *"
                + " FROM TestResult"
                + " WHERE [DateCreated] > '1/1/2021'");

            ITestCaseResultCollection testCaseResults = testManagementTeamProject.TestResults.Query(query);
            int totalItems = testCaseResults.Count;

            int[] associatedWIs = testCaseResults.QueryAssociatedWorkItems();

            XlHlp.DisplayInWatchWindow($"Processing ({ totalItems }) testCaseResults");

            foreach (ITestResult testResult in testCaseResults)
            {
                insertAt.ClearOffsets();

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), testManagementTeamProject.TeamProjectName);

                // IAttachmentOwner

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testResult.Attachments.Count}");

                // ITestResult
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testResult.CollectorsEnabled.Count}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testResult.Comment}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testResult.DateCreated}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testResult.DateStarted}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testResult.DateCompleted}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testResult.Duration}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testResult.ErrorMessage}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testResult.Outcome}");



                insertAt.IncrementRows();
                itemCount++;

                AZDOHelper.ProcessItemDelay(options);
                AZDOHelper.DisplayLoopUpdates(startTicks, options, totalItems, itemCount);
            }

            Log.APPLICATION("Exit", Common.LOG_CATEGORY, startTicks);

            return(itemCount);
        }
Esempio n. 11
0
        internal static int Add_TestEnvironments(
            Excel.XlLocation insertAt,
            Options_AZDO_TFS options,
            ITestManagementTeamProject testManagementTeamProject)
        {
            Int64 startTicks = Log.APPLICATION("Enter", Common.LOG_CATEGORY);

            int itemCount = 0;

            string query = String.Format(
                "SELECT *"
                + " FROM TestEnvironment");

            var testEnvironments = testManagementTeamProject.TestEnvironments.Query();
            var totalItems       = testEnvironments.Count();

            XlHlp.DisplayInWatchWindow($"Processing ({ totalItems } testEnvironments");

            foreach (ITestEnvironment testEnvironment in testEnvironments)
            {
                insertAt.ClearOffsets();
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), testManagementTeamProject.TeamProjectName);

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), testEnvironment.Id.ToString());
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testEnvironment.Name}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testEnvironment.ControllerDisplayName}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testEnvironment.ControllerEnvironmentId}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testEnvironment.ControllerName}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testEnvironment.DateCreated}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testEnvironment.Description}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testEnvironment.DisplayName}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testEnvironment.EnvironmentType}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testEnvironment.Error}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testEnvironment.InvalidProperties.Count()}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testEnvironment.IsDirty}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testEnvironment.LabEnvironmentUri}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testEnvironment.LabServerUri}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testEnvironment.MachineRoles.Count}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testEnvironment.Owner}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testEnvironment.TeamProject.TeamProjectName}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testEnvironment.TestController.Name}");

                insertAt.IncrementRows();
                itemCount++;

                //ProcessItemDelay(options);
                AZDOHelper.DisplayLoopUpdates(startTicks, options, totalItems, itemCount);
            }

            Log.APPLICATION("Exit", Common.LOG_CATEGORY, startTicks);

            return(itemCount);
        }
Esempio n. 12
0
        internal static int Add_TestConfigurations(Excel.XlLocation insertAt,
                                                   Options_AZDO_TFS options,
                                                   ITestManagementTeamProject testManagementTeamProject)
        {
            Int64 startTicks = Log.APPLICATION("Enter", Common.LOG_CATEGORY);

            int itemCount = 0;

            string query = String.Format(
                "SELECT *"
                + " FROM TestConfiguration");

            ITestConfigurationCollection testConfigurations = testManagementTeamProject.TestConfigurations.Query(query);
            int totalItems = testConfigurations.Count;

            XlHlp.DisplayInWatchWindow($"Processing ({ totalItems } testConfigurations");

            foreach (ITestConfiguration testConfiguration in testConfigurations)
            {
                insertAt.ClearOffsets();
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testManagementTeamProject.TeamProjectName}");

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.Id}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.Name}");

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.AreaPath}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.Description}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.IsDefault}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.LastUpdated}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.LastUpdatedByName}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.Revision}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.State}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testConfiguration.Values.Count}");

                insertAt.IncrementRows();
                itemCount++;

                //ProcessItemDelay(options);
                AZDOHelper.DisplayLoopUpdates(startTicks, options, totalItems, itemCount);
            }

            Log.APPLICATION("Exit", Common.LOG_CATEGORY, startTicks);

            return(itemCount);
        }
Esempio n. 13
0
        internal static int Add_TestSettings(
            Excel.XlLocation insertAt,
            Options_AZDO_TFS options,
            ITestManagementTeamProject testManagementTeamProject)
        {
            Int64 startTicks = Log.APPLICATION("Enter", Common.LOG_CATEGORY);

            int itemCount = 0;

            string query = String.Format(
                "SELECT *"
                + " FROM TestSettings");

            IEnumerable <ITestSettings> testSettings = testManagementTeamProject.TestSettings.Query(query);
            int totalItems = testSettings.Count();

            XlHlp.DisplayInWatchWindow($"Processing ({ totalItems } testRuns");

            foreach (ITestSettings testSetting in testSettings)
            {
                insertAt.ClearOffsets();

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testManagementTeamProject.TeamProjectName}");

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSetting.Id}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSetting.IsAutomated}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSetting.LastUpdated}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSetting.LastUpdatedBy}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSetting.MachineRoles.Count}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSetting.Name}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSetting.Revision}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testSetting.Settings}");

                insertAt.IncrementRows();
                itemCount++;

                AZDOHelper.ProcessItemDelay(options);
                AZDOHelper.DisplayLoopUpdates(startTicks, options, totalItems, itemCount);
            }

            Log.APPLICATION("Exit", Common.LOG_CATEGORY, startTicks);

            return(itemCount);
        }
Esempio n. 14
0
        private void PopulateSitesPicker(string uri)
        {
            // NB.  This does not recurse.  Just gets direct subsites.

            try
            {
                using (var ctx = new ClientContext(uri))
                {
                    //ctx.Credentials = new NetworkCredential("user", "password", "domain");

                    var web = ctx.Web;

                    ctx.Load(web, info => info.Webs);
                    ctx.ExecuteQuery();

                    //ctx.Load(web.Webs);
                    //ctx.ExecuteQuery();

                    var itemCol = cbeWeb.Items;

                    itemCol.BeginUpdate();
                    itemCol.Clear();

                    foreach (Web w in web.Webs)
                    {
                        // Some stuff came with the web already
                        //ctx.Load(w);
                        ////ctx.Load(w, info => info.Url, info => info.Title);
                        //ctx.ExecuteQuery();

                        XlHlp.DisplayInWatchWindow(string.Format("{0} - {1}", w.Title, w.ServerRelativeUrl));
                        string subSiteUrl = string.Format("{0}{1}", uri, w.ServerRelativeUrl);
                        itemCol.Add(subSiteUrl);
                    }

                    itemCol.EndUpdate();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Esempio n. 15
0
        private XlHlp.XlLocation AddSection_SiteColumns(XlHlp.XlLocation insertAt, ClientContext ctx, Web web)
        {
            long startTicks = XlHlp.DisplayInWatchWindow(insertAt);

            if (insertAt.OrientVertical)
            {
                XlHlp.AddLabeledInfoX(insertAt.AddRowX(), "SiteColumns", web.Title);
            }
            else
            {
                XlHlp.AddLabeledInfoX(insertAt.AddRowX(), "SiteColumns", web.Title, orientation: XlOrientation.xlUpward);
                insertAt.IncrementColumns();
            }

            var siteColumns = VNCSP.Helper.GetSiteColumns(ctx, web);

            //ctx.Load(web.Fields);
            //ctx.ExecuteQuery();

            //var siteColumns = web.Fields;

            //ctx.ExecuteQuery();


            insertAt.MarkStart(XlHlp.MarkType.GroupTable);


            insertAt = DisplayListOf_SiteColumns(insertAt, siteColumns, false, "OneLevel");


            insertAt.MarkEnd(XlHlp.MarkType.GroupTable, string.Format("tblSiteColumns_{0}", web.Title));

            insertAt.Group(insertAt.OrientVertical, hide: true);

            insertAt.EndSectionAndSetNextLocation(insertAt.OrientVertical);

            XlHlp.DisplayInWatchWindow(insertAt, startTicks, "End");

            return(insertAt);
        }
Esempio n. 16
0
        private void CreateWS_SiteCollection_Info(ClientContext ctx, bool param1)
        {
            XlHlp.DisplayInWatchWindow(string.Format("{0}",
                                                     System.Reflection.MethodInfo.GetCurrentMethod().Name));

            var site = ctx.Site;
            var web  = ctx.Web;


            ctx.Load(site);
            ctx.ExecuteQuery();

            // Display Site (SiteCollection stuff)

            ctx.Load(web);
            ctx.ExecuteQuery();

            foreach (Web w in web.Webs)
            {
                XlHlp.DisplayInWatchWindow(w.Title);
            }
        }
Esempio n. 17
0
        private XlHlp.XlLocation AddSection_WebInfo(XlHlp.XlLocation insertAt, ClientContext ctx, Web web)
        {
            long startTicks = XlHlp.DisplayInWatchWindow(insertAt);

            //ctx.Load(web, info => info.HasUniqueRoleAssignments);
            //ctx.Load(web1,
            //    info => info.Url,
            //    info => info.MasterUrl,
            //    info => info.Description,
            //    info => info.HasUniqueRoleAssignments,
            //    info => info.Created);
            //ctx.ExecuteQuery();

            XlHlp.AddLabeledInfoX(insertAt.AddOffsetRowX(), "Url:", ctx.Url);
            XlHlp.AddLabeledInfoX(insertAt.AddOffsetRowX(), "Title:", web.Title);
            XlHlp.AddLabeledInfoX(insertAt.AddOffsetRowX(), "Created:", web.Created.ToString());
            XlHlp.AddLabeledInfoX(insertAt.AddOffsetRowX(), "Description:", web.Description);
            XlHlp.AddLabeledInfoX(insertAt.AddOffsetRowX(), "Id:", web.Id.ToString());
            //XlHlp.AddTitledInfo(ws.Cells[startingRow++, 1], "HasUniqueRoleAssignments:", web.HasUniqueRoleAssignments.ToString());
            //XlHlp.AddTitledInfo(ws.Cells[startingRow++, 1], "MasterUrl:", web.MasterUrl);

            return(insertAt);
        }
Esempio n. 18
0
        private XlHlp.XlLocation AddSection_ContentTypes(XlHlp.XlLocation insertAt, ClientContext ctx, Web web)
        {
            long startTicks = XlHlp.DisplayInWatchWindow(insertAt);

            if (insertAt.OrientVertical)
            {
                XlHlp.AddLabeledInfoX(insertAt.AddRowX(), "ContentTypes", web.Title);
            }
            else
            {
                XlHlp.AddLabeledInfoX(insertAt.AddRowX(), "ContentTypes", web.Title, orientation: XlOrientation.xlUpward);
                insertAt.IncrementColumns();
            }

            ctx.Load(web.ContentTypes);
            ctx.ExecuteQuery();

            //IEnumerable<List> cTypes = ctx.LoadQuery(allContentTypes.Where
            //    (list => list.BaseType == BaseType.DocumentLibrary)
            //    );

            ctx.ExecuteQuery();

            insertAt.MarkStart(XlHlp.MarkType.GroupTable);

            insertAt = DisplayListOf_ContentTypes(insertAt, web.ContentTypes, false, "Full");

            insertAt.MarkEnd(XlHlp.MarkType.GroupTable, string.Format("tblContentTypes_{0}", web.Title));

            insertAt.Group(insertAt.OrientVertical, hide: true);

            insertAt.EndSectionAndSetNextLocation(insertAt.OrientVertical);

            XlHlp.DisplayInWatchWindow(insertAt, startTicks, "End");

            return(insertAt);
        }
Esempio n. 19
0
        internal static int Add_TestRuns(
            Excel.XlLocation insertAt,
            Options_AZDO_TFS options,
            ITestManagementTeamProject testManagementTeamProject)
        {
            Int64 startTicks = Log.APPLICATION("Enter", Common.LOG_CATEGORY);

            int itemCount = 0;

            string query = String.Format(
                "SELECT *"
                + " FROM TestRun");
            //+ " WHERE [DateCreated] > '1/1/2021'");

            IEnumerable <ITestRun> testRuns = testManagementTeamProject.TestRuns.Query(query);
            int totalItems = testRuns.Count();

            XlHlp.DisplayInWatchWindow($"Processing ({ totalItems } testRuns");

            foreach (ITestRun testRun in testRuns)
            {
                insertAt.ClearOffsets();

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), testManagementTeamProject.TeamProjectName);

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.Title}");

                // IAttachmentOwner

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.Attachments.Count}");

                // ITestRun

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.BuildConfigurationId}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.BuildDirectory}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.BuildFlavor}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.BuildNumber}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.BuildPlatform}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.BuildUri}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.IsBvt}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.Iteration}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.LastUpdated}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.LastUpdatedByName}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.LinkedWorkItemCount}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.NotApplicableTests}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.OwnerName}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.PassedTests}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.PostProcessState}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.Project.TeamProjectName}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.Revision}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.State}");

                try
                {
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.Statistics.CompletedTests}");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.Statistics.FailedTests}");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.Statistics.InconclusiveTests}");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.Statistics.InProgressTests}");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.Statistics.PassedTests}");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.Statistics.PendingTests}");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.Statistics.TotalTests}");
                }
                catch (Exception ex)
                {
                    var message = ex.ToString();
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), "<Exception>");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), "<Exception>");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), "<Exception>");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), "<Exception>");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), "<Exception>");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), "<Exception>");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), "<Exception>");
                }

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.TestEnvironmentId}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.TestMessageLogEntries.Count}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.TestPlanId}");

                string testSettingsName = "<null>";
                string testSettingsId   = "<null>";

                if (testRun.TestSettings != null)
                {
                    testSettingsName = $"{testRun.TestSettings.Name}";
                    testSettingsId   = $"{testRun.TestSettings.Id}";
                }

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), testSettingsName);
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), testSettingsId);

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.TestSettingsId}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.TotalTests}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.Type}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.UnanalyzedTests}");
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testRun.Version}");

                insertAt.IncrementRows();
                itemCount++;

                AZDOHelper.ProcessItemDelay(options);
                AZDOHelper.DisplayLoopUpdates(startTicks, options, totalItems, itemCount);
            }

            Log.APPLICATION("Exit", Common.LOG_CATEGORY, startTicks);

            return(itemCount);
        }
Esempio n. 20
0
        private XlHlp.XlLocation DisplayListOf_SiteColumns(XlHlp.XlLocation insertAt, IEnumerable <Field> siteColumns, bool displayDataOnly, string tableSuffix)
        {
            long startTicks = XlHlp.DisplayInWatchWindow(insertAt);

            Worksheet ws = insertAt.workSheet;

            //<Field
            //ID="{56747800-D36E-4625-ABE3-B1BC74A7D5F8}"
            //Name="LowerValuesAreBetter"
            //StaticName="LowerValuesAreBetter"
            //Description="Whether lower is better or higher is better"
            //Group="Status Indicators" Type="Boolean"
            //DisplayName="Lower values are better"
            //SourceID="http://schemas.microsoft.com/sharepoint/v3" />

            //<Field
            //Type="Lookup"
            //DisplayName="FA Page Type"
            //Required="FALSE"
            //EnforceUniqueValues="FALSE"
            //List="{b1d6a5ff-876b-4761-a05d-210038e31639}"
            //WebId="666b287f-2709-476b-a739-e1de9150fb37"
            //ShowField="Title"
            //UnlimitedLengthInDocumentLibrary="FALSE"
            //Group="Custom Columns"
            //ID="{3090abc3-526c-458f-9c65-302ad853db65}"
            //SourceID="{666b287f-2709-476b-a739-e1de9150fb37}"
            //StaticName="FA_x0020_Page_x0020_Type"
            //Name="FA_x0020_Page_x0020_Type" />


            if (!displayDataOnly)
            {
                insertAt.MarkStart(XlHlp.MarkType.GroupTable);

                XlHlp.AddColumnHeaderToSheetX(insertAt.AddOffsetColumnX(), 40, "Title");
                XlHlp.AddColumnHeaderToSheetX(insertAt.AddOffsetColumnX(), 40, "Name");
                XlHlp.AddColumnHeaderToSheetX(insertAt.AddOffsetColumnX(), 40, "StaticName");
                XlHlp.AddColumnHeaderToSheetX(insertAt.AddOffsetColumnX(), 40, "Description");
                XlHlp.AddColumnHeaderToSheetX(insertAt.AddOffsetColumnX(), 30, "Group");
                XlHlp.AddColumnHeaderToSheetX(insertAt.AddOffsetColumnX(), 15, "Id");
                XlHlp.AddColumnHeaderToSheetX(insertAt.AddOffsetColumnX(), 15, "TypeAsString");
                XlHlp.AddColumnHeaderToSheetX(insertAt.AddOffsetColumnX(), 20, "SchemaXml");

                insertAt.IncrementRows();
            }

            foreach (var field in siteColumns)
            {
                insertAt.ClearOffsets();

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), field.Title);
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), field.Group);
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), field.Id.ToString());
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), field.TypeAsString.ToString());
                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), field.SchemaXml);

                insertAt.IncrementRows();
            }

            XlHlp.DisplayInWatchWindow(insertAt, startTicks, "End");

            return(insertAt);
        }
Esempio n. 21
0
        internal static int Add_TestPlans(
            Excel.XlLocation insertAt,
            Options_AZDO_TFS options,
            ITestManagementTeamProject testManagementTeamProject)
        {
            Int64 startTicks = Log.APPLICATION("Enter", Common.LOG_CATEGORY);

            int itemCount = 0;

            //string query = String.Format(
            //    "SELECT [System.Id]"
            //    + " FROM TestPlan"
            //    + " WHERE [Team Project] = '{0}'", testManagementTeamProject.TeamProjectName);

            string query = String.Format(
                "SELECT *"
                + " FROM TestPlan");

            ITestPlanCollection testPlans = testManagementTeamProject.TestPlans.Query(query);
            int totalItems = testPlans.Count;

            XlHlp.DisplayInWatchWindow($"Processing ({ totalItems } testPlans");

            foreach (var testPlan in testPlans)
            {
                insertAt.ClearOffsets();

                XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testManagementTeamProject.TeamProjectName}");

                try
                {
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testPlan.Id}");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testPlan.Name}");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testPlan.Description}");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testPlan.State}");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testPlan.AreaPath}");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testPlan.Iteration}");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testPlan.StartDate}");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testPlan.EndDate}");

                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testPlan.OwnerName}");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testPlan.LastUpdated}");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testPlan.LastUpdatedByName}");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testPlan.Revision}");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testPlan.Links.Count}");
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{testPlan.RootSuite.Id}");
                }
                catch (Exception ex)
                {
                    XlHlp.AddOffsetContentToCell(insertAt.AddOffsetColumn(), $"{ex}");
                }

                insertAt.IncrementRows();
                itemCount++;

                AZDOHelper.ProcessItemDelay(options);
                AZDOHelper.DisplayLoopUpdates(startTicks, options, totalItems, itemCount);
            }

            Log.APPLICATION("Exit", Common.LOG_CATEGORY, startTicks);

            return(itemCount);
        }