public void TestCapability_RequestAsset_KnownId_FailureHandlerNotCalled() { var cap = new Capability(); var callbackError = new AssetError(); cap.RequestAsset(_knownTextureAsset.Id, asset => { }, error => callbackError = error); Assert.That(() => callbackError, Is.EqualTo(new AssetError()).After(200).MilliSeconds, $"Got error:\n\n{callbackError}"); }
public void TestCapAdmin_RequestTextureAssetOnCap_good_DoesntCallErrHandler() { var capId = Guid.NewGuid(); _capAdmin.AddCap(ADMIN_TOKEN, capId); var errMessage = new AssetError(); _capAdmin.RequestTextureAssetOnCap(capId, _knownTextureAsset.Id, a => { }, a => errMessage = a); Assert.That(() => errMessage, Is.EqualTo(new AssetError()).After(100).MilliSeconds, $"Got error:\n\n{errMessage}"); }
public async Task <IActionResult> ReportError([FromBody] AssetErrorDTO error) { try { AssetError assetError = new AssetError() { Title = error.Title, Description = error.Description }; _assetErrorService.Insert(assetError); return(Ok(assetError)); } catch (Exception ex) { return(StatusCode((int)HttpStatusCode.InternalServerError)); } }