Example #1
0
        public void GetDistinctDatabaseList_Should_ReturnDictionary()
        {
            // Arrange
            ShimReportData.ConstructorGuidGuid = (_, site, webApp) => { };
            ShimReportData.AllInstances.GetDistinctDbMappings = _ => new ShimDataTable
            {
                RowsGet = () => new ShimDataRowCollection
                {
                    GetEnumerator = () => new List <DataRow>
                    {
                        new ShimDataRow
                        {
                            ItemGetString = name => DummyString
                        }
                    }.GetEnumerator()
                }
            };

            // Act
            var result = reportBiz.GetDistinctDatabaseList();

            // Assert
            result.ShouldSatisfyAllConditions(
                () => result.ShouldNotBeNull(),
                () => result.ShouldNotBeEmpty(),
                () => result.Keys.ShouldContain($"{DummyString}:{DummyString}"));
        }
Example #2
0
        private void ConfigureServerForm()
        {
            Guid webAppId = Guid.Empty;

            if (Request.QueryString["id"] != null)
            {
                webAppId = new Guid(Request.QueryString["id"]);
                var rb = new ReportBiz(SPContext.Current.Site.ID, webAppId);
                Dictionary <string, string> databases = rb.GetDistinctDatabaseList();
                DataRow SAInfo = rb.SAccountInfo(webAppId);
                if (SAInfo != null && (bool)SAInfo["SAccount"])
                {
                    username.Text     = SAInfo["Username"].ToString();
                    password.Text     = SAInfo["Password"].ToString();
                    sacccount.Checked = true;
                }
            }
            btnExisting.Checked = true; //Default setting
        }