private void AddIzendaReportDisposesConnectionsTest(bool shouldThrow) { using (TestCheck.OpenCloseConnections) { // Arrange ArrangeAddIzendaReport(shouldThrow); // Act Action action = () => ApiReporting.AddIzendaReport(new ShimSPWeb(), "DummyTitle", "DummyXml", out _errorString); // Assert this.ShouldSatisfyAllConditions( () => action.ShouldNotThrow(), () => { if (shouldThrow) { _errorString.ShouldBe("Test Exception"); } else { _errorString.ShouldBeNullOrWhiteSpace(); } }, () => _iAddIzendaReportWasCalled.ShouldBeTrue()); } }
public void Setup() { _context = ShimsContext.Create(); _reporting = new ApiReporting(); _privateType = new PrivateType(typeof(ApiReporting)); }