Ready to test
This commit is contained in:
@ -3,6 +3,7 @@ using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Net.Http;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Adaptation._Tests.Static;
|
||||
@ -47,34 +48,42 @@ public class Job : LoggingUnitTesting, IDisposable
|
||||
[TestMethod]
|
||||
public void TestJobA()
|
||||
{
|
||||
string mid;
|
||||
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"));
|
||||
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"12-123456-1234\", \"Recipe\": \"Recipe\"}");
|
||||
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");
|
||||
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"-544481-\", \"Recipe\": \"Recipe\"}");
|
||||
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");
|
||||
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"00-544481-0000\", \"Recipe\": \"Recipe\"}");
|
||||
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");
|
||||
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08THFTIRQS408M\", \"MesEntity\": \"BIORAD2\", \"Sequence\": \"123456789\", \"MID\": \"37--\", \"Recipe\": \"Recipe\"}");
|
||||
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");
|
||||
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"00-o171308.1.51-0000\", \"Recipe\": \"Recipe\", \"Slot\": \"11\"}");
|
||||
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");
|
||||
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE5\", \"Sequence\": \"638163023363575829\", \"MID\": \"B48\", \"Recipe\": \"lsl_6in \"}");
|
||||
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");
|
||||
@ -92,7 +101,9 @@ public class Job : LoggingUnitTesting, IDisposable
|
||||
string barcodeHostFileShare = FileHandlers.TIBCO.FileRead.BarcodeHostFileShare;
|
||||
string lsl2SQLConnectionString = FileHandlers.TIBCO.FileRead.LSL2SQLConnectionString;
|
||||
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"CDE4\", \"Sequence\": \"123456789\", \"MID\": \"P1234\", \"Recipe\": \"Recipe\"}");
|
||||
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));
|
||||
@ -110,7 +121,28 @@ public class Job : LoggingUnitTesting, IDisposable
|
||||
string barcodeHostFileShare = FileHandlers.TIBCO.FileRead.BarcodeHostFileShare;
|
||||
string lsl2SQLConnectionString = FileHandlers.TIBCO.FileRead.LSL2SQLConnectionString;
|
||||
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
job = new(lsl2SQLConnectionString, metrologyFileShare, barcodeHostFileShare, "{\"Area\": \"Si\", \"EquipmentType\": \"MET08RESIMAPCDE\", \"MesEntity\": \"BIORAD3\", \"Sequence\": \"638234699589174855\", \"MID\": \"33--\", \"Recipe\": \"Recipe\"}");
|
||||
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));
|
||||
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
[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\": \"32\", \"Sequence\": \"638234699589174855\", \"MID\": \"32--\", \"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));
|
||||
|
Reference in New Issue
Block a user