/// <summary> /// The Invoke method for the compute func - calls the TAG file processing executor to do the work /// </summary> public SubmitTAGFileResponse Invoke(SubmitTAGFileRequestArgument arg) { try { var executor = new SubmitTAGFileExecutor(); return(executor.ExecuteAsync(arg.ProjectID, arg.AssetID, arg.TAGFileName, arg.TagFileContent, arg.TCCOrgID, arg.TreatAsJohnDoe, arg.SubmissionFlags, arg.OriginSource).WaitAndUnwrapException()); } catch (Exception e) { _log.LogError(e, $"Exception submitting TAG file {arg.TAGFileName}"); return(new SubmitTAGFileResponse { Message = "Exception", Success = false }); } }
public async Task DeviceLKS_CB460_SentOk() { var projectUid = Guid.NewGuid(); SetupDIDeviceGateay(true); byte[] tagContent; using (var tagFileStream = new FileStream(Path.Combine("TestData", "TAGFiles", "TestTAGFile.tag"), FileMode.Open, FileAccess.Read)) { tagContent = new byte[tagFileStream.Length]; tagFileStream.Read(tagContent, 0, (int)tagFileStream.Length); } var td = new TagFileDetail() { assetId = null, projectId = projectUid, tagFileName = "Test.tag", tagFileContent = tagContent, tccOrgId = "", IsJohnDoe = false }; var tagFilePreScan = new TAGFilePreScan(); await using (var stream = new MemoryStream(td.tagFileContent)) tagFilePreScan.Execute(stream); Assert.NotNull(tagFilePreScan); Assert.Equal("0523J019SW", tagFilePreScan.HardwareID); var executor = new SubmitTAGFileExecutor(); executor.SendDeviceStatusToDeviceGateway(td, tagFilePreScan); }