Dual write PDSF for Metrology Viewer
json body Path.GetDirectoryName(_FileConnectorConfiguration.AlternateTargetFolder) PostOpenInsightMetrologyViewerAttachments Ready to test InterceptIQS Version Error Message Using pattern ... Tests Passed CA1862 and GetWeekOfYear for WritePDSF Commit a0c1c665: Save Copy - sql or json gitignore cellInstanceVersion.EdaConnection.PortNumber cellInstanceVersion.EdaConnection.PortNumber Added Climatec to Test.cs GetJobIdDirectory Remove and NETFRAMEWORK 5-Other-Small
This commit is contained in:
@ -2,8 +2,10 @@ using Adaptation._Tests.Shared;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
@ -38,6 +40,13 @@ public class MET08RESIHGCV : LoggingUnitTesting, IDisposable
|
||||
LoggingUnitTesting?.Dispose();
|
||||
}
|
||||
|
||||
private static void NonThrowTryCatch()
|
||||
{
|
||||
try
|
||||
{ throw new Exception(); }
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestDateTime()
|
||||
{
|
||||
@ -55,7 +64,7 @@ public class MET08RESIHGCV : LoggingUnitTesting, IDisposable
|
||||
StringBuilder results = new();
|
||||
(string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[]
|
||||
{
|
||||
new("MET08RESIHGCV", "v2.52.0"),
|
||||
new("MET08RESIHGCV", "v2.56.0"),
|
||||
};
|
||||
string staging = "http://mestsa07ec.infineon.com:9003/CellInstanceServiceV2";
|
||||
Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion;
|
||||
@ -65,8 +74,55 @@ public class MET08RESIHGCV : LoggingUnitTesting, IDisposable
|
||||
cellInstanceVersion = AdaptationTesting.GetCellInstanceVersion($"{staging}/{cellInstanceName}/{cellInstanceVersionName}/configuration");
|
||||
_ = results.AppendLine($"{cellInstanceName}\t{cellInstanceVersionName}\t{cellInstanceVersion.EdaConnection.PortNumber}");
|
||||
}
|
||||
File.WriteAllText($"D:/Tmp/{methodBase.Module.Name}-{methodBase.ReflectedType.Name}-{methodBase.Name}.tsv", results.ToString());
|
||||
string sourceDirectory = "D:/Tmp/cellInstanceVersion.EdaConnection.PortNumber";
|
||||
if (!Directory.Exists(sourceDirectory))
|
||||
_ = Directory.CreateDirectory(sourceDirectory);
|
||||
File.WriteAllText(Path.Combine(sourceDirectory, $"{methodBase.Module.Name}-{methodBase.ReflectedType.Name}-{methodBase.Name}.tsv"), results.ToString());
|
||||
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void CellInstanceVersionEdaConnectionPortNumber()
|
||||
{
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
string sourceDirectory = "D:/Tmp/cellInstanceVersion.EdaConnection.PortNumber";
|
||||
if (Directory.Exists(sourceDirectory))
|
||||
{
|
||||
string destinationDirectory = Path.Combine(sourceDirectory, "All");
|
||||
if (!Directory.Exists(destinationDirectory))
|
||||
_ = Directory.CreateDirectory(destinationDirectory);
|
||||
List<string> lines = new();
|
||||
string[] files = Directory.GetFiles(sourceDirectory, "*.tsv", SearchOption.TopDirectoryOnly);
|
||||
foreach (string file in files)
|
||||
lines.AddRange(File.ReadAllLines(file));
|
||||
File.WriteAllLines(Path.Combine(destinationDirectory, $"{DateTime.Now.Ticks}.tsv"), lines.Distinct().OrderBy(l => l));
|
||||
}
|
||||
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestDeltaMean()
|
||||
{
|
||||
// (0.3864 – 0.4286) / 0.4286 * 100 = -9.846 %
|
||||
float a = 0.4286f;
|
||||
float b = 0.3864f;
|
||||
float c = 100;
|
||||
float d = -9.84601f;
|
||||
Assert.IsTrue((b - a) / a * c == d);
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TestSubgroupId()
|
||||
{
|
||||
int subgroupId = 1715715363;
|
||||
DateTime ticksDateTime = new(638512869386943434);
|
||||
DateTime epicDateTime = new(1970, 01, 01, 0, 0, 0, DateTimeKind.Utc);
|
||||
DateTime subgroupIdDateTime = epicDateTime.AddSeconds(subgroupId).ToLocalTime();
|
||||
TimeSpan timeSpan = new(ticksDateTime.Ticks - subgroupIdDateTime.Ticks);
|
||||
Assert.IsTrue(timeSpan.TotalHours is < 1 and > (-1));
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
}
|
@ -2,8 +2,10 @@ using Adaptation._Tests.Shared;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
@ -202,9 +204,9 @@ public class PCL : LoggingUnitTesting, IDisposable
|
||||
StringBuilder results = new();
|
||||
(string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[]
|
||||
{
|
||||
new("HGCV1", "v2.52.0"),
|
||||
new("HGCV2", "v2.52.0"),
|
||||
new("HGCV3", "v2.52.0"),
|
||||
new("HGCV1", "v2.56.0"),
|
||||
new("HGCV2", "v2.56.0"),
|
||||
new("HGCV3", "v2.56.0"),
|
||||
new("HGCV1-EQPT", "v2.12.3"),
|
||||
new("HGCV2-EQPT", "v2.12.3"),
|
||||
new("HGCV3-EQPT", "v2.12.3"),
|
||||
@ -217,8 +219,31 @@ public class PCL : LoggingUnitTesting, IDisposable
|
||||
cellInstanceVersion = AdaptationTesting.GetCellInstanceVersion($"{staging}/{cellInstanceName}/{cellInstanceVersionName}/configuration");
|
||||
_ = results.AppendLine($"{cellInstanceName}\t{cellInstanceVersionName}\t{cellInstanceVersion.EdaConnection.PortNumber}");
|
||||
}
|
||||
File.WriteAllText($"D:/Tmp/{methodBase.Module.Name}-{methodBase.ReflectedType.Name}-{methodBase.Name}.tsv", results.ToString());
|
||||
string sourceDirectory = "D:/Tmp/cellInstanceVersion.EdaConnection.PortNumber";
|
||||
if (!Directory.Exists(sourceDirectory))
|
||||
_ = Directory.CreateDirectory(sourceDirectory);
|
||||
File.WriteAllText(Path.Combine(sourceDirectory, $"{methodBase.Module.Name}-{methodBase.ReflectedType.Name}-{methodBase.Name}.tsv"), results.ToString());
|
||||
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void CellInstanceVersionEdaConnectionPortNumber()
|
||||
{
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
string sourceDirectory = "D:/Tmp/cellInstanceVersion.EdaConnection.PortNumber";
|
||||
if (Directory.Exists(sourceDirectory))
|
||||
{
|
||||
string destinationDirectory = Path.Combine(sourceDirectory, "All");
|
||||
if (!Directory.Exists(destinationDirectory))
|
||||
_ = Directory.CreateDirectory(destinationDirectory);
|
||||
List<string> lines = new();
|
||||
string[] files = Directory.GetFiles(sourceDirectory, "*.tsv", SearchOption.TopDirectoryOnly);
|
||||
foreach (string file in files)
|
||||
lines.AddRange(File.ReadAllLines(file));
|
||||
File.WriteAllLines(Path.Combine(destinationDirectory, $"{DateTime.Now.Ticks}.tsv"), lines.Distinct().OrderBy(l => l));
|
||||
}
|
||||
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user