public void CoverageDataContext_GetTestUrl_Success() { var sut = new CoverageDataContext(_resourceId, Web.EmitionTypes.Cover, "http://127.0.0.0.1:3142/secure/Coverage1/.coverage"); var result = sut.GetTestUrl(@"/resources/path/" + _resourceId.ToString()); Assert.AreEqual("http://127.0.0.0.1:3142/secure//resources/path/3c2df19f-e5ab-4ed7-b7ff-7e6e43d94649.tests", result); }
public void CoverageDataContext_GetAllTestsUrl() { var sut = new CoverageDataContext(Guid.NewGuid(), Web.EmitionTypes.Cover, "http://127.0.0.0.1:3142/secure/Coverage1/.coverage"); var result = sut.GetAllTestsUrl(); Assert.AreEqual("/secure/Coverage1/.tests", result); }
public void CoverageDataContext_CTOR_DefaultSetup_With_NonEmptyGuid() { var sut = new CoverageDataContext(_resourceId, Web.EmitionTypes.Cover, "http://127.0.0.0.1:3142"); Assert.AreEqual(_resourceId, sut.ResourceID); Assert.IsFalse(sut.IsMultipleWorkflowReport); Assert.AreEqual(Web.EmitionTypes.Cover, sut.ReturnType); }
public void CoverageDataContext_CTOR_DefaultSetup_With_EmptyGuid() { var sut = new CoverageDataContext(Guid.Empty, Web.EmitionTypes.Cover, "http://127.0.0.0.1:3142") { CoverageReportResourceIds = new Guid[] { _resourceId }, }; Assert.AreEqual(Guid.Empty, sut.ResourceID); Assert.IsTrue(sut.IsMultipleWorkflowReport); Assert.AreEqual(Web.EmitionTypes.Cover, sut.ReturnType); Assert.AreEqual(_resourceId, sut.CoverageReportResourceIds.First()); }
private IResponseWriter ExecuteAsCoverage(WebRequestTO webRequest, string serviceName, IWarewolfResource resource) { try { var coverageDataContext = new CoverageDataContext(_dataObject.ResourceID, _dataObject.ReturnType, webRequest.WebServerUrl); coverageDataContext.SetTestCoverageResourceIds(_resourceCatalog.NewContextualResourceCatalog(_authorizationService, _workspaceGuid), webRequest, serviceName, resource); var formatter = ServiceTestCoverageExecutor.GetTestCoverageReports(coverageDataContext, _workspaceGuid, _serializer, _testCoverageCatalog, _resourceCatalog, out _executePayload); return(new StringResponseWriter(_executePayload ?? string.Empty, formatter.ContentType)); } finally { Dev2DataListDecisionHandler.Instance.RemoveEnvironment(_dataObject.DataListID); _dataObject.Environment = null; } }
public void CoverageDataContext_GetTestUrl_Failure() { var sut = new CoverageDataContext(_resourceId, Web.EmitionTypes.Cover, "http://127.0.0.0.1:3142"); Assert.ThrowsException <Exception>(() => sut.GetTestUrl(@"/resources/path/" + _resourceId.ToString()), "unable to generate test uri: unexpected uri"); }