public void GetWorkspaceCenterGridData_Standard_ReturnsXml()
        {
            // Arrange, Act
            var result = WorkspaceCenter.GetWorkspaceCenterGridData(DummyString, new ShimSPWeb());

            // Assert
            result.ShouldNotBeNullOrEmpty();
            this.ShouldSatisfyAllConditions(
                () => result.ShouldContain($"<I WorkSpace=\"&lt;div&gt; &lt;div style='float:left;'&gt;&lt;a href='{ExampleUrl}'&gt;{WebTitle}&lt;/a&gt;"),
                () => result.ShouldContain($"&lt;/div&gt;&lt;div style='float:right;'&gt;&lt;ul style='margin: 0px; width: 20px;'&gt;&lt;li class='workspacecentercontextmenu' id='{DefaultWebId}'&gt;"),
                () => result.ShouldContain($"&lt;a data-webid='{DefaultWebId}' data-siteid='{DefaultSiteId}'&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;\""),
                () => result.ShouldContain($"Description=\"{WebDescription}\" Owner=\"{SharePointAccountText}\" CreateDate=\"{DefaultDate.ToShortDateString()}\" ModifiedDate=\"{DefaultDate.ToShortDateString()}\" Members=\"{Members}\" />"));
        }
        public void GetWorkSpaceCenterLayout_Invoke_ReturnsXml()
        {
            // Arrange
            var expectedDocument = XDocument.Parse(Resources.WorkSpaceCenterLayout);

            // Act
            var result = WorkspaceCenter.GetWorkSpaceCenterLayout(DummyString);

            // Assert
            expectedDocument.ShouldNotBeNull();
            result.ShouldNotBeNullOrEmpty();
            result.ShouldBe(expectedDocument.ToString());
        }
        public void GetSpContentDbSqlConnection_ApiException_Throws()
        {
            // Arrange
            ShimSPSecurity.RunWithElevatedPrivilegesSPSecurityCodeToRunElevated =
                _ => { throw new APIException(DefaultErrorNumber, DummyString); };

            // Act
            var action = new Action(() => WorkspaceCenter.GetSpContentDbSqlConnection(new ShimSPWeb()));

            // Assert
            var exception = action.ShouldThrow <APIException>();

            this.ShouldSatisfyAllConditions(
                () => exception.ExceptionNumber.ShouldBe(DefaultErrorNumber),
                () => exception.Message.ShouldBe(DummyString));
        }