protected void BindRedmineData()
        {
            string userName = WebPartsHelper.GetPersonalPageUserName();

            SPWeb web = SPControl.GetContextWeb(HttpContext.Current);
            AppSettingsSection appSettings = WebPartsHelper.GetWebAppSettings(web);

            RedmineData.InitParams(appSettings);

            List <RedmineIssue> issuesByUser = RedmineData.GetUserIssuesAndSetCache(userName);
            Array issuesArrayForGridView     = RedmineData.ConvertRedmineIssuesToArrayForGridView(issuesByUser);

            RedmineGridView.PagerTemplate = null;
            RedmineGridView.DataSource    = issuesArrayForGridView;
            RedmineGridView.DataBind();
        }
예제 #2
0
        public void GetUserIssuesAndSetCacheTest()
        {
            ExeConfigurationFileMap fileMap = new ExeConfigurationFileMap();

            fileMap.ExeConfigFilename = @"C:\inetpub\wwwroot\wss\VirtualDirectories\443\web.config";
            Configuration config = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None);

            RedmineData.InitParams(config.AppSettings);

            var userName = "******";
            List <RedmineIssue> issuesByUser = RedmineData.GetUserIssuesAndSetCache(userName);

            //int expectedIssuesCount = 13;
            //Assert.AreEqual(expectedIssuesCount, issuesByUser.Count);
            Assert.IsTrue(issuesByUser.Count > 0);
        }