public void GetWorkspaceCenterGridData_Standard_ReturnsXml() { // Arrange, Act var result = WorkspaceCenter.GetWorkspaceCenterGridData(DummyString, new ShimSPWeb()); // Assert result.ShouldNotBeNullOrEmpty(); this.ShouldSatisfyAllConditions( () => result.ShouldContain($"<I WorkSpace=\"<div> <div style='float:left;'><a href='{ExampleUrl}'>{WebTitle}</a>"), () => result.ShouldContain($"</div><div style='float:right;'><ul style='margin: 0px; width: 20px;'><li class='workspacecentercontextmenu' id='{DefaultWebId}'>"), () => result.ShouldContain($"<a data-webid='{DefaultWebId}' data-siteid='{DefaultSiteId}'></a></li></ul></div></div>\""), () => 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)); }