ProcessDataStandardFormat

run.json
descriptions.json
Infineon.Mesa.PDF.Text.Stripper 4.8.0.2
MSTEST0037
This commit is contained in:
Mike Phares 2025-03-03 11:42:17 -07:00
parent 959bf66fa9
commit 4d41e545b3
12 changed files with 283 additions and 177 deletions

View File

@ -122,6 +122,7 @@ dotnet_diagnostic.IDE0290.severity = none # Use primary constructor [Distance]cs
dotnet_diagnostic.IDE0300.severity = none # IDE0300: Collection initialization can be simplified
dotnet_diagnostic.IDE0301.severity = none #IDE0301: Collection initialization can be simplified
dotnet_diagnostic.IDE0305.severity = none # IDE0305: Collection initialization can be simplified
dotnet_diagnostic.MSTEST0037.severity = error # MSTEST0037: Use proper 'Assert' methods
dotnet_diagnostic.SYSLIB1045.severity = none # SYSLIB1045: diagnostics for regex source generation
dotnet_naming_rule.abstract_method_should_be_pascal_case.severity = warning
dotnet_naming_rule.abstract_method_should_be_pascal_case.style = pascal_case

View File

@ -1,24 +1,26 @@
namespace Adaptation.FileHandlers.TIBCO.Transport;
#nullable enable
public class Input
{
public string Area { get; }
public string EquipmentType { get; }
public string MID { get; }
public string Slot { get; }
public string MesEntity { get; }
public string Recipe { get; }
public string Sequence { get; }
public string? Area { get; }
public string? EquipmentType { get; }
public string? MID { get; }
public string? Slot { get; }
public string? MesEntity { get; }
public string? Recipe { get; }
public string? Sequence { get; }
[System.Text.Json.Serialization.JsonConstructor]
public Input(string area,
string equipmentType,
string mid,
string slot,
string mesEntity,
string recipe,
string sequence)
public Input(string? area,
string? equipmentType,
string? mid,
string? slot,
string? mesEntity,
string? recipe,
string? sequence)
{
Area = area;
@ -30,7 +32,7 @@ public class Input
Sequence = sequence;
}
internal Input(Input input, string mid)
internal Input(Input input, string? mid)
{
Area = input.Area;
EquipmentType = input.EquipmentType;

View File

@ -174,7 +174,7 @@ public partial class Job
private static bool IsInvalid(int? rdsNumber) => rdsNumber is null or < 100000 or > 100000000;
private static (string?, string?) GetReactorAndRDS(string text, string formattedText, string[] segments)
private static (string?, string?) GetReactorAndRDS(string? text, string formattedText, string[] segments)
{
string? rds;
string? reactor;
@ -243,10 +243,13 @@ public partial class Job
string? reactor;
string? employee;
int? reactorNumber;
string[] segments = input.MID.Split(new char[] { '-' });
// bool hasRDS = Regex.IsMatch(input.MID, "[-]?([QP][0-9]{4,}|[0-9]{5,})[-]?");
string formattedText = Regex.Replace(input.MID, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
(reactor, rds) = GetReactorAndRDS(input.MID, formattedText, segments);
string mid = string.IsNullOrEmpty(input.MID) ? string.Empty : input.MID;
if (mid.Length > 2 && mid[0] == '1' && (mid[1] == 'T' || mid[1] == 't'))
mid = mid.Substring(2);
mid = Regex.Replace(mid, @"[\\,\/,\:,\*,\?,\"",\<,\>,\|]", "_").Split('\r')[0].Split('\n')[0];
string[] segments = mid.Split(new char[] { '-' });
// bool hasRDS = Regex.IsMatch(mid, "[-]?([QP][0-9]{4,}|[0-9]{5,})[-]?");
(reactor, rds) = GetReactorAndRDS(input.MID, mid, segments);
if (string.IsNullOrEmpty(rds))
rdsNumber = 0;
else
@ -381,8 +384,9 @@ public partial class Job
WorkOrder workOrder;
Task<Stream> streamTask;
Task<HttpResponseMessage> httpResponseMessageTask;
string mid = string.IsNullOrEmpty(input.MID) ? string.Empty : input.MID;
JsonSerializerOptions jsonSerializerOptions = new() { PropertyNameCaseInsensitive = true };
int? reactor = !int.TryParse(input.MID.Substring(0, 2), out int reactorNumber) ? null : reactorNumber;
int? reactor = mid.Length < 2 || !int.TryParse(mid.Substring(0, 2), out int reactorNumber) ? null : reactorNumber;
httpResponseMessageTask = httpClient.GetAsync($"{httpClient.BaseAddress}/reactors/{reactor}");
httpResponseMessageTask.Wait();
if (httpResponseMessageTask.Result.StatusCode != System.Net.HttpStatusCode.OK)
@ -450,7 +454,8 @@ public partial class Job
int? rds;
long sequence = 0;
WorkOrder workOrder;
int? reactor = !int.TryParse(input.MID.Substring(0, 2), out int reactorNumber) ? null : reactorNumber;
string mid = string.IsNullOrEmpty(input.MID) ? string.Empty : input.MID;
int? reactor = mid.Length < 2 || !int.TryParse(mid.Substring(0, 2), out int reactorNumber) ? null : reactorNumber;
bool parsed = !string.IsNullOrEmpty(input.Sequence) && long.TryParse(input.Sequence, out sequence);
List<string> files;
if (!parsed || string.IsNullOrEmpty(input.MID))
@ -505,80 +510,85 @@ public partial class Job
private static string GetCommandText(int? rds, int? workOrderNumber, int? workOrderCassette, int? slot, int? reactor)
{ // cSpell:disable
StringBuilder result = new();
_ = result.Append(" select ").
Append(" rr.rds_no ").
Append(" , rr.reactor ").
Append(" , rr.ps_no ").
Append(" , rr.load_lock_side ").
Append(" , rr.reactor_type ").
Append(" , rr.recipe_name ").
Append(" , rr.recipe_no ").
Append(" , rr.spec_type ").
Append(" , ( ").
Append(" select max(wm.zone) ").
Append(" from lsl2sql.dbo.wm_out_slot wm ").
Append(" where wm.wo_no = rr.wo_no ").
Append(" and wm.rds = rr.rds_no ").
Append(" and wm.in_cass_no = ").Append(workOrderCassette is null ? -1 : workOrderCassette.Value).Append(' ').
Append(" and wm.slot_no = ").Append(slot is null ? -1 : slot.Value).Append(' ').
Append(" ) zone ").
Append(" from lsl2sql.dbo.react_run rr ").
Append(" where rr.rds_no = ").Append(rds is null ? -1 : rds.Value).Append(' ').
Append(" union all ").
Append(" select ").
Append(" rr.rds_no ").
Append(" , rr.reactor ").
Append(" , rr.ps_no ").
Append(" , rr.load_lock_side ").
Append(" , rr.reactor_type ").
Append(" , rr.recipe_name ").
Append(" , rr.recipe_no ").
Append(" , rr.spec_type ").
Append(" , ( ").
Append(" select max(wm.zone) ").
Append(" from lsl2sql.dbo.wm_out_slot wm ").
Append(" where wm.wo_no = rr.wo_no ").
Append(" and wm.rds = rr.rds_no ").
Append(" and wm.in_cass_no = ").Append(workOrderCassette is null ? -1 : workOrderCassette.Value).Append(' ').
Append(" and wm.slot_no = ").Append(slot is null ? -1 : slot.Value).Append(' ').
Append(" ) zone ").
Append(" from lsl2sql.dbo.react_run rr ").
Append(" where rr.rds_no = ( ").
Append(" select max(wm.rds) ").
Append(" from lsl2sql.dbo.wm_out_slot wm ").
Append(" where wm.wo_no = ").Append(workOrderNumber is null ? -1 : workOrderNumber.Value).Append(' ').
Append(" and wm.in_cass_no = ").Append(workOrderCassette is null ? -1 : workOrderCassette.Value).Append(' ').
Append(" and wm.slot_no = ").Append(slot is null ? -1 : slot.Value).Append(' ').
Append(" ) ").
Append(" union all ").
Append(" select ").
Append(" rr.rds_no ").
Append(" , rr.reactor ").
Append(" , rr.ps_no ").
Append(" , rr.load_lock_side ").
Append(" , rr.reactor_type ").
Append(" , rr.recipe_name ").
Append(" , rr.recipe_no ").
Append(" , rr.spec_type ").
Append(" , ( ").
Append(" select max(wm.zone) ").
Append(" from lsl2sql.dbo.wm_out_slot wm ").
Append(" where wm.wo_no = rr.wo_no ").
Append(" and wm.rds = rr.rds_no ").
Append(" and wm.in_cass_no = ").Append(workOrderCassette is null ? -1 : workOrderCassette.Value).Append(' ').
Append(" and wm.slot_no = ").Append(slot is null ? -1 : slot.Value).Append(' ').
Append(" ) zone ").
Append(" from lsl2sql.dbo.react_run rr ").
Append(" where rr.rds_no = ( ").
Append(" select max(qa.rds_no) ").
Append(" from lsl2sql.dbo.react_run qa ").
Append(" where qa.load_sig != '' ").
Append(" and qa.load_sig_dtm > '2023-05-01 00:00:00.000' ").
Append(" and qa.reactor = ").Append(reactor is null ? -1 : reactor.Value).Append(' ').
Append(" ) ").
Append(" for json path ");
return result.ToString();
List<string> results = new();
int rdsValue = rds is null ? -1 : rds.Value;
int slotValue = slot is null ? -1 : slot.Value;
int reactorValue = reactor is null ? -1 : reactor.Value;
int workOrderNumberValue = workOrderNumber is null ? -1 : workOrderNumber.Value;
int workOrderCassetteValue = workOrderCassette is null ? -1 : workOrderCassette.Value;
results.Add(" select ");
results.Add(" rr.rds_no ");
results.Add(" , rr.reactor ");
results.Add(" , rr.ps_no ");
results.Add(" , rr.load_lock_side ");
results.Add(" , rr.reactor_type ");
results.Add(" , rr.recipe_name ");
results.Add(" , rr.recipe_no ");
results.Add(" , rr.spec_type ");
results.Add(" , ( ");
results.Add(" select max(wm.zone) ");
results.Add(" from lsl2sql.dbo.wm_out_slot wm ");
results.Add(" where wm.wo_no = rr.wo_no ");
results.Add(" and wm.rds = rr.rds_no ");
results.Add($" and wm.in_cass_no = {workOrderCassetteValue}");
results.Add($" and wm.slot_no = {slotValue}");
results.Add(" ) zone ");
results.Add(" from lsl2sql.dbo.react_run rr ");
results.Add($" where rr.rds_no = {rdsValue}");
results.Add(" union all ");
results.Add(" select ");
results.Add(" rr.rds_no ");
results.Add(" , rr.reactor ");
results.Add(" , rr.ps_no ");
results.Add(" , rr.load_lock_side ");
results.Add(" , rr.reactor_type ");
results.Add(" , rr.recipe_name ");
results.Add(" , rr.recipe_no ");
results.Add(" , rr.spec_type ");
results.Add(" , ( ");
results.Add(" select max(wm.zone) ");
results.Add(" from lsl2sql.dbo.wm_out_slot wm ");
results.Add(" where wm.wo_no = rr.wo_no ");
results.Add(" and wm.rds = rr.rds_no ");
results.Add($" and wm.in_cass_no = {workOrderCassetteValue}");
results.Add($" and wm.slot_no = {slotValue}");
results.Add(" ) zone ");
results.Add(" from lsl2sql.dbo.react_run rr ");
results.Add(" where rr.rds_no = ( ");
results.Add(" select max(wm.rds) ");
results.Add(" from lsl2sql.dbo.wm_out_slot wm ");
results.Add($" where wm.wo_no = {workOrderNumberValue}");
results.Add($" and wm.in_cass_no = {workOrderCassetteValue}");
results.Add($" and wm.slot_no = {slotValue}");
results.Add(" ) ");
results.Add(" union all ");
results.Add(" select ");
results.Add(" rr.rds_no ");
results.Add(" , rr.reactor ");
results.Add(" , rr.ps_no ");
results.Add(" , rr.load_lock_side ");
results.Add(" , rr.reactor_type ");
results.Add(" , rr.recipe_name ");
results.Add(" , rr.recipe_no ");
results.Add(" , rr.spec_type ");
results.Add(" , ( ");
results.Add(" select max(wm.zone) ");
results.Add(" from lsl2sql.dbo.wm_out_slot wm ");
results.Add(" where wm.wo_no = rr.wo_no ");
results.Add(" and wm.rds = rr.rds_no ");
results.Add($" and wm.in_cass_no = {workOrderCassetteValue}");
results.Add($" and wm.slot_no = {slotValue}");
results.Add(" ) zone ");
results.Add(" from lsl2sql.dbo.react_run rr ");
results.Add(" where rr.rds_no = ( ");
results.Add(" select max(qa.rds_no) ");
results.Add(" from lsl2sql.dbo.react_run qa ");
results.Add(" where qa.load_sig != '' ");
results.Add(" and qa.load_sig_dtm > '2023-05-01 00:00:00.000' ");
results.Add($" and qa.reactor = {reactorValue}");
results.Add(" ) ");
results.Add(" for json path ");
return string.Join(Environment.NewLine, results);
} // cSpell:restore
private static CommonB Get(string lsl2SQLConnectionString, string layer, string psn, int? reactorNumber, int? slotNumber, int? workOrderNumber, int? workOrderCassette, string zone)

View File

@ -308,9 +308,13 @@ public class ProcessData : IProcessData
if (description.Test != (int)tests[i])
throw new Exception();
}
FileInfo fileInfo = new($"{logistics.ReportFullPath}.descriptions.json");
List<Description> fileReadDescriptions = (from l in descriptions select (Description)l).ToList();
string json = JsonSerializer.Serialize(fileReadDescriptions, fileReadDescriptions.GetType());
JsonElement[] jsonElements = JsonSerializer.Deserialize<JsonElement[]>(json);
File.WriteAllText(fileInfo.FullName, json);
File.SetLastWriteTime(fileInfo.FullName, logistics.DateTimeFromSequence);
fileInfoCollection.Add(fileInfo);
JsonElement[] jsonElements = JsonSerializer.Deserialize<JsonElement[]>(json) ?? throw new Exception();
results = new Tuple<string, Test[], JsonElement[], List<FileInfo>>(logistics.Logistics1[0], tests.ToArray(), jsonElements, fileInfoCollection);
return results;
}

View File

@ -27,7 +27,7 @@ internal class Run
private static void WriteJson(Logistics logistics, List<FileInfo> fileInfoCollection, Run result)
{
FileInfo fileInfo = new($"{logistics.ReportFullPath}.json");
FileInfo fileInfo = new($"{logistics.ReportFullPath}.run.json");
string json = JsonSerializer.Serialize(result, RunSourceGenerationContext.Default.Run);
File.WriteAllText(fileInfo.FullName, json);
File.SetLastWriteTime(fileInfo.FullName, logistics.DateTimeFromSequence);
@ -105,7 +105,7 @@ internal class Run
List<WaferSummaryInfo> dnnTotals = new();
Header header = Header.Get(constant, i, text);
Summary summary = Summary.Get(constant, i, text, dcnTotals, dwnTotals, dnnTotals);
ReadOnlyCollection<Wafer> wafers = Wafer.Get(constant, dcnTotals, dwnTotals, dnnTotals);
ReadOnlyCollection<Wafer> wafers = Wafer.Get(dcnTotals, dwnTotals, dnnTotals);
if (wafers.Count == 0)
result = null;
else

View File

@ -203,7 +203,7 @@ public class Wafer
public string DnnBin7 { get; }
public string DnnBin8 { get; }
internal static ReadOnlyCollection<Wafer> Get(Constant constant, List<WaferSummaryInfo> dcnTotals, List<WaferSummaryInfo> dwnTotals, List<WaferSummaryInfo> dnnTotals)
internal static ReadOnlyCollection<Wafer> Get(List<WaferSummaryInfo> dcnTotals, List<WaferSummaryInfo> dwnTotals, List<WaferSummaryInfo> dnnTotals)
{
List<Wafer> results = new();
Wafer wafer;

View File

@ -69,7 +69,7 @@
<PackageReference Include="System.Text.Json" Version="9.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Infineon.Mesa.PDF.Text.Stripper" Version="4.8.0.1"><NoWarn>NU1701</NoWarn></PackageReference>
<PackageReference Include="Infineon.Mesa.PDF.Text.Stripper" Version="4.8.0.2"><NoWarn>NU1701</NoWarn></PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Infineon.Yoda.DotNetCore" Version="5.4.3" />

View File

@ -152,9 +152,11 @@ public class ProcessDataStandardFormat
{
string value;
string[] segments;
List<string> lines = new();
StringBuilder stringBuilder = new();
foreach (string bodyLine in bodyLines)
{
_ = stringBuilder.Clear();
_ = stringBuilder.Append('{');
segments = bodyLine.Trim().Split('\t');
if (!lookForNumbers)
@ -179,10 +181,11 @@ public class ProcessDataStandardFormat
}
}
_ = stringBuilder.Remove(stringBuilder.Length - 1, 1);
_ = stringBuilder.AppendLine("},");
_ = stringBuilder.AppendLine("}");
lines.Add(stringBuilder.ToString());
}
_ = stringBuilder.Remove(stringBuilder.Length - 3, 3);
results = JsonSerializer.Deserialize<JsonElement[]>(string.Concat("[", stringBuilder, "]"));
string json = $"[{string.Join(",", lines)}]";
results = JsonSerializer.Deserialize<JsonElement[]>(json);
}
return results;
}

View File

@ -1111,7 +1111,7 @@ public class AdaptationTesting : ISMTP
pdsfFiles = Directory.GetFiles(searchDirectory, searchPattern, SearchOption.TopDirectoryOnly);
if (pdsfFiles.Length == 0)
_ = Process.Start("explorer.exe", searchDirectory);
Assert.IsTrue(pdsfFiles.Length != 0, "GetFiles check");
Assert.AreNotEqual(0, pdsfFiles.Length, "GetFiles check");
results = GetLogisticsColumnsAndBody(pdsfFiles[0]);
}
Assert.IsFalse(string.IsNullOrEmpty(results.Item1));
@ -1259,13 +1259,13 @@ public class AdaptationTesting : ISMTP
Tuple<string, string[], string[]> pdsf = GetLogisticsColumnsAndBody(variables[2], variables[4]);
Tuple<string, string[], string[]> pdsfNew = GetLogisticsColumnsAndBody(fileRead, logistics, extractResult, pdsf);
CompareSave(variables[5], pdsf, pdsfNew);
Assert.IsTrue(pdsf.Item1 == pdsfNew.Item1, "Item1 check!");
Assert.AreEqual(pdsfNew.Item1, pdsf.Item1, "Item1 check!");
string[] json = GetItem2(pdsf, pdsfNew);
CompareSaveJSON(variables[5], json);
Assert.IsTrue(json[0] == json[1], "Item2 check!");
Assert.AreEqual(json[1], json[0], "Item2 check!");
string[] join = GetItem3(pdsf, pdsfNew);
CompareSaveTSV(variables[5], join);
Assert.IsTrue(join[0] == join[1], "Item3 (Join) check!");
Assert.AreEqual(join[1], join[0], "Item3 (Join) check!");
}
UpdatePassDirectory(variables[2]);
}

View File

@ -44,7 +44,9 @@ public class Job : LoggingUnitTesting, IDisposable
catch (Exception) { }
}
#if !Always
[Ignore]
#endif
[TestMethod]
public void TestJobA()
{
@ -58,40 +60,42 @@ public class Job : LoggingUnitTesting, IDisposable
HttpClient httpClient = new() { BaseAddress = new(FileHandlers.TIBCO.FileRead.OpenInsightApplicationProgrammingInterface) };
mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"12-123456-1234\", \"Recipe\": \"Recipe\"}";
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "21");
Assert.IsTrue(job.LotName == "123456");
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "4609");
Assert.IsFalse(string.IsNullOrEmpty(job.ProcessType)); // == "21");
Assert.AreEqual("123456", job.LotName);
Assert.IsFalse(string.IsNullOrEmpty(job.ProductName)); // == "4609");
mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"12-1234567-1234\", \"Recipe\": \"Recipe\"}";
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "21");
Assert.IsTrue(job.LotName == "1234567");
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "4609");
Assert.IsFalse(string.IsNullOrEmpty(job.ProcessType)); // == "21");
Assert.AreEqual("1234567", job.LotName);
Assert.IsFalse(string.IsNullOrEmpty(job.ProductName)); // == "4609");
mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"-544481-\", \"Recipe\": \"Recipe\"}";
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "51");
Assert.IsTrue(job.LotName == "544481");
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "5158");
Assert.IsFalse(string.IsNullOrEmpty(job.ProcessType)); // == "51");
Assert.AreEqual("544481", job.LotName);
Assert.IsFalse(string.IsNullOrEmpty(job.ProductName)); // == "5158");
mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"00-544481-0000\", \"Recipe\": \"Recipe\"}";
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "51");
Assert.IsTrue(job.LotName == "544481");
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "5158");
Assert.IsFalse(string.IsNullOrEmpty(job.ProcessType)); // == "51");
Assert.AreEqual("544481", job.LotName);
Assert.IsFalse(string.IsNullOrEmpty(job.ProductName)); // == "5158");
mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"00-o171308.1.51-0000\", \"Recipe\": \"Recipe\", \"Slot\": \"11\"}";
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "54");
Assert.IsTrue(!string.IsNullOrEmpty(job.LotName)); // == "547000");
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "4445");
Assert.IsFalse(string.IsNullOrEmpty(job.ProcessType)); // == "54");
Assert.IsFalse(string.IsNullOrEmpty(job.LotName)); // == "547000");
Assert.IsFalse(string.IsNullOrEmpty(job.ProductName)); // == "4445");
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE5\", \"Sequence\": \"638163023363575829\", \"MID\": \"B48\", \"Recipe\": \"lsl_6in \"}";
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType)); // == "54");
Assert.IsTrue(!string.IsNullOrEmpty(job.LotName)); // == "547000");
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "4445");
Assert.IsFalse(string.IsNullOrEmpty(job.ProcessType)); // == "54");
Assert.IsFalse(string.IsNullOrEmpty(job.LotName)); // == "547000");
Assert.IsFalse(string.IsNullOrEmpty(job.ProductName)); // == "4445");
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
NonThrowTryCatch();
}
#if !Always
[Ignore]
#endif
[TestMethod]
public void TestJobAA()
{
@ -105,14 +109,16 @@ public class Job : LoggingUnitTesting, IDisposable
HttpClient httpClient = new() { BaseAddress = new(FileHandlers.TIBCO.FileRead.OpenInsightApplicationProgrammingInterface) };
mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08THFTIRQS408M\", \"MesEntity\": \"BIORAD2\", \"Sequence\": \"123456789\", \"MID\": \"37--\", \"Recipe\": \"Recipe\"}";
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
Assert.IsTrue(job.ProcessType == "37");
Assert.IsTrue(!string.IsNullOrEmpty(job.LotName)); // == "549918");
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName)); // == "5101");
Assert.AreEqual("37", job.ProcessType);
Assert.IsFalse(string.IsNullOrEmpty(job.LotName)); // == "549918");
Assert.IsFalse(string.IsNullOrEmpty(job.ProductName)); // == "5101");
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
NonThrowTryCatch();
}
#if !Always
[Ignore]
#endif
[TestMethod]
public void TestJobB()
{
@ -125,14 +131,16 @@ public class Job : LoggingUnitTesting, IDisposable
HttpClient httpClient = new() { BaseAddress = new(FileHandlers.TIBCO.FileRead.OpenInsightApplicationProgrammingInterface) };
string mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"P1234\", \"Recipe\": \"Recipe\"}";
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType));
Assert.IsTrue(!string.IsNullOrEmpty(job.LotName));
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName));
Assert.IsFalse(string.IsNullOrEmpty(job.ProcessType));
Assert.IsFalse(string.IsNullOrEmpty(job.LotName));
Assert.IsFalse(string.IsNullOrEmpty(job.ProductName));
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
NonThrowTryCatch();
}
#if !Always
[Ignore]
#endif
[TestMethod]
public void TestJobC()
{
@ -145,16 +153,42 @@ public class Job : LoggingUnitTesting, IDisposable
HttpClient httpClient = new() { BaseAddress = new(FileHandlers.TIBCO.FileRead.OpenInsightApplicationProgrammingInterface) };
string mid = "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"BIORAD3\", \"Sequence\": \"638234699589174855\", \"MID\": \"33--\", \"Recipe\": \"Recipe\"}";
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType));
Assert.IsTrue(!string.IsNullOrEmpty(job.LotName));
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName));
Assert.IsFalse(string.IsNullOrEmpty(job.ProcessType));
Assert.IsFalse(string.IsNullOrEmpty(job.LotName));
Assert.IsFalse(string.IsNullOrEmpty(job.ProductName));
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
NonThrowTryCatch();
}
#if !Always
[Ignore]
#endif
[TestMethod]
public void TestJobD()
{
FileHandlers.TIBCO.Transport.Job job;
MethodBase methodBase = new StackFrame().GetMethod();
string metrologyFileShare =
FileHandlers.TIBCO.FileRead.MetrologyFileShare;
string barcodeHostFileShare = FileHandlers.TIBCO.FileRead.BarcodeHostFileShare;
string lsl2SQLConnectionString = FileHandlers.TIBCO.FileRead.LSL2SQLConnectionString;
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
HttpClient httpClient = new() { BaseAddress = new(FileHandlers.TIBCO.FileRead.OpenInsightApplicationProgrammingInterface) };
string mid = "{\"Area\": \"Si\", \"EquipmentType\": \"DEP08CEPIEPSILON\", \"MesEntity\": \"R32\", \"Sequence\": \"\", \"MID\": \"32--\", \"Recipe\": \"Recipe\"}";
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
Assert.IsFalse(string.IsNullOrEmpty(job.ProcessType));
Assert.IsFalse(string.IsNullOrEmpty(job.LotName));
Assert.IsFalse(string.IsNullOrEmpty(job.ProductName));
Assert.IsFalse(string.IsNullOrEmpty(job.Equipment));
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
NonThrowTryCatch();
}
#if !Always
[Ignore]
#endif
[TestMethod]
public void TestJobE()
{
FileHandlers.TIBCO.Transport.Job job;
MethodBase methodBase = new StackFrame().GetMethod();
@ -163,12 +197,64 @@ public class Job : LoggingUnitTesting, IDisposable
string lsl2SQLConnectionString = FileHandlers.TIBCO.FileRead.LSL2SQLConnectionString;
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
HttpClient httpClient = new() { BaseAddress = new(FileHandlers.TIBCO.FileRead.OpenInsightApplicationProgrammingInterface) };
string mid = "{\"Area\": \"Si\", \"EquipmentType\": \"DEP08CEPIEPSILON\", \"MesEntity\": \"R32\", \"Sequence\": \"\", \"MID\": \"32--\", \"Recipe\": \"Recipe\"}";
string mid = """
{"Area": "Si", "EquipmentType": "MET08RESIMAPCDE", "MesEntity": "CDE5", "Sequence": "638756365880000000", "MID": "38-660275-5095.1", "Recipe": "IRC6mm"}
""";
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
Assert.IsTrue(!string.IsNullOrEmpty(job.ProcessType));
Assert.IsTrue(!string.IsNullOrEmpty(job.LotName));
Assert.IsTrue(!string.IsNullOrEmpty(job.ProductName));
Assert.IsTrue(!string.IsNullOrEmpty(job.Equipment));
Assert.IsFalse(string.IsNullOrEmpty(job.ProcessType));
Assert.IsFalse(string.IsNullOrEmpty(job.LotName));
Assert.IsFalse(string.IsNullOrEmpty(job.ProductName));
Assert.IsFalse(string.IsNullOrEmpty(job.Equipment));
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
NonThrowTryCatch();
}
#if !Always
[Ignore]
#endif
[TestMethod]
public void TestJobF()
{
FileHandlers.TIBCO.Transport.Job job;
MethodBase methodBase = new StackFrame().GetMethod();
string metrologyFileShare = FileHandlers.TIBCO.FileRead.MetrologyFileShare;
string barcodeHostFileShare = FileHandlers.TIBCO.FileRead.BarcodeHostFileShare;
string lsl2SQLConnectionString = FileHandlers.TIBCO.FileRead.LSL2SQLConnectionString;
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
HttpClient httpClient = new() { BaseAddress = new(FileHandlers.TIBCO.FileRead.OpenInsightApplicationProgrammingInterface) };
string mid = """
{"Area": "Si", "EquipmentType": "MET08THFTIRQS408M", "MesEntity": "BIORAD2", "Sequence": "638757112479659597", "MID": "173308.1.5", "Recipe": "6inTHICK"}
""";
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
Assert.IsFalse(string.IsNullOrEmpty(job.ProcessType));
Assert.IsFalse(string.IsNullOrEmpty(job.LotName));
Assert.IsFalse(string.IsNullOrEmpty(job.ProductName));
Assert.IsFalse(string.IsNullOrEmpty(job.Equipment));
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
NonThrowTryCatch();
}
#if !Always
[Ignore]
#endif
[TestMethod]
public void TestJobG()
{
FileHandlers.TIBCO.Transport.Job job;
MethodBase methodBase = new StackFrame().GetMethod();
string metrologyFileShare = FileHandlers.TIBCO.FileRead.MetrologyFileShare;
string barcodeHostFileShare = FileHandlers.TIBCO.FileRead.BarcodeHostFileShare;
string lsl2SQLConnectionString = FileHandlers.TIBCO.FileRead.LSL2SQLConnectionString;
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
HttpClient httpClient = new() { BaseAddress = new(FileHandlers.TIBCO.FileRead.OpenInsightApplicationProgrammingInterface) };
string mid = """
{"Area": "Si", "EquipmentType": "MET08DDUPSFS6420", "MesEntity": "TENCOR1", "Sequence": "638765945581765554", "MID": "1T661282", "Recipe": "8IN_THIN ROTR"}
""";
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, httpClient, mid);
Assert.IsFalse(string.IsNullOrEmpty(job.ProcessType));
Assert.IsFalse(string.IsNullOrEmpty(job.LotName));
Assert.IsFalse(string.IsNullOrEmpty(job.ProductName));
Assert.IsFalse(string.IsNullOrEmpty(job.Equipment));
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
NonThrowTryCatch();
}

View File

@ -51,7 +51,7 @@ public class MET08DDUPSP1TBI : LoggingUnitTesting, IDisposable
public void TestDateTime()
{
DateTime dateTime = DateTime.Now;
Assert.IsTrue(dateTime.ToString("M/d/yyyy h:mm:ss tt") == dateTime.ToString());
Assert.AreEqual(dateTime.ToString(), dateTime.ToString("M/d/yyyy h:mm:ss tt"));
}
#if DEBUG

View File

@ -52,7 +52,7 @@ public class TXT : LoggingUnitTesting, IDisposable
public void TestDateTime()
{
DateTime dateTime = DateTime.Now;
Assert.IsTrue(dateTime.ToString("M/d/yyyy h:mm:ss tt") == dateTime.ToString());
Assert.AreEqual(dateTime.ToString(), dateTime.ToString("M/d/yyyy h:mm:ss tt"));
}
[TestMethod]
@ -69,22 +69,22 @@ public class TXT : LoggingUnitTesting, IDisposable
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = ProcessData.GetDescriptor("12-123456-1234");
Assert.IsTrue(descriptor.Reactor is "12");
Assert.IsTrue(descriptor.RDS is "123456");
Assert.IsTrue(descriptor.PSN is "1234");
Assert.AreEqual("12", descriptor.Reactor);
Assert.AreEqual("123456", descriptor.RDS);
Assert.AreEqual("1234", descriptor.PSN);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = ProcessData.GetDescriptor("123456");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor));
Assert.IsTrue(descriptor.RDS is "123456");
Assert.AreEqual("123456", descriptor.RDS);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = ProcessData.GetDescriptor("1T123456");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor));
Assert.IsTrue(descriptor.RDS is "123456");
Assert.AreEqual("123456", descriptor.RDS);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
@ -93,96 +93,96 @@ public class TXT : LoggingUnitTesting, IDisposable
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(descriptor.Employee is "MP");
Assert.AreEqual("MP", descriptor.Employee);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
descriptor = ProcessData.GetDescriptor("12-123456-1234.2-1");
Assert.IsTrue(descriptor.Reactor is "12");
Assert.IsTrue(descriptor.RDS is "123456");
Assert.IsTrue(descriptor.PSN is "1234");
Assert.IsTrue(descriptor.Layer is "2");
Assert.IsTrue(descriptor.Zone is "1");
Assert.AreEqual("12", descriptor.Reactor);
Assert.AreEqual("123456", descriptor.RDS);
Assert.AreEqual("1234", descriptor.PSN);
Assert.AreEqual("2", descriptor.Layer);
Assert.AreEqual("1", descriptor.Zone);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = ProcessData.GetDescriptor("12-123456-1234.02-1");
Assert.IsTrue(descriptor.Reactor is "12");
Assert.IsTrue(descriptor.RDS is "123456");
Assert.IsTrue(descriptor.PSN is "1234");
Assert.IsTrue(descriptor.Layer is "2");
Assert.IsTrue(descriptor.Zone is "1");
Assert.AreEqual("12", descriptor.Reactor);
Assert.AreEqual("123456", descriptor.RDS);
Assert.AreEqual("1234", descriptor.PSN);
Assert.AreEqual("2", descriptor.Layer);
Assert.AreEqual("1", descriptor.Zone);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = ProcessData.GetDescriptor("20");
Assert.IsTrue(descriptor.Reactor is "20");
Assert.AreEqual("20", descriptor.Reactor);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = ProcessData.GetDescriptor("20.2");
Assert.IsTrue(descriptor.Reactor is "20");
Assert.AreEqual("20", descriptor.Reactor);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(descriptor.Layer is "2");
Assert.AreEqual("2", descriptor.Layer);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = ProcessData.GetDescriptor("20.2.1");
Assert.IsTrue(descriptor.Layer is "2");
Assert.AreEqual("2", descriptor.Layer);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS));
Assert.IsTrue(descriptor.Reactor is "20");
Assert.IsTrue(descriptor.Zone is "1");
Assert.AreEqual("20", descriptor.Reactor);
Assert.AreEqual("1", descriptor.Zone);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = ProcessData.GetDescriptor("20.1.1");
Assert.IsTrue(descriptor.Layer is "1");
Assert.AreEqual("1", descriptor.Layer);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS));
Assert.IsTrue(descriptor.Reactor is "20");
Assert.IsTrue(descriptor.Zone is "1");
Assert.AreEqual("20", descriptor.Reactor);
Assert.AreEqual("1", descriptor.Zone);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = ProcessData.GetDescriptor("P2-LOW-RR");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(descriptor.PSN is "RR");
Assert.AreEqual("RR", descriptor.PSN);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS));
Assert.IsTrue(descriptor.Reactor is "P2");
Assert.AreEqual("P2", descriptor.Reactor);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = ProcessData.GetDescriptor("i171308.1.51");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(descriptor.RDS is "i171308.1.51");
Assert.AreEqual("i171308.1.51", descriptor.RDS);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = ProcessData.GetDescriptor("o171308.1.51");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(descriptor.RDS is "o171308.1.51");
Assert.AreEqual("o171308.1.51", descriptor.RDS);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = ProcessData.GetDescriptor("O171308.1.51");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(descriptor.RDS is "O171308.1.51");
Assert.AreEqual("O171308.1.51", descriptor.RDS);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = ProcessData.GetDescriptor("171308.1.51");
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(descriptor.RDS is "171308.1.51");
Assert.AreEqual("171308.1.51", descriptor.RDS);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = ProcessData.GetDescriptor("75-QP1414-SPLIT4");
Assert.IsTrue(!string.IsNullOrEmpty(descriptor.Lot));
Assert.IsFalse(string.IsNullOrEmpty(descriptor.Lot));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(descriptor.PSN is "SPLIT4");
Assert.AreEqual("SPLIT4", descriptor.PSN);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS));
Assert.IsTrue(descriptor.Reactor is "75");
Assert.AreEqual("75", descriptor.Reactor);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee));
descriptor = ProcessData.GetDescriptor("B48");
Assert.IsTrue(descriptor.Lot == "B48");
Assert.AreEqual("B48", descriptor.Lot);
Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));
Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN));