net8.0
v2_52_0-Tests editorconfig yml ec fix yml explicit contents dotnet_diagnostic CA1862 and GetWeekOfYear for WritePDSF gitignore cellInstanceVersion.EdaConnection.PortNumber Added Climatec to Test.cs GetJobIdDirectory Remove and Remove Microsoft.AspNet.WebApi.SelfHost 5-Other-Small
This commit is contained in:
@ -305,7 +305,7 @@ public class AdaptationTesting : ISMTP
|
||||
else
|
||||
{
|
||||
results = Directory.GetFiles(mbn.TextFileDirectory, "*.txt", SearchOption.TopDirectoryOnly);
|
||||
if (!string.IsNullOrEmpty(mbn.Ticks) && _HasWaitForProperty && !results.Any())
|
||||
if (!string.IsNullOrEmpty(mbn.Ticks) && _HasWaitForProperty && results.Length == 0)
|
||||
{
|
||||
_ = Process.Start("explorer.exe", mbn.TextFileDirectory);
|
||||
File.WriteAllText(Path.Combine(mbn.TextFileDirectory, "_ Why.why"), string.Empty);
|
||||
@ -373,9 +373,7 @@ public class AdaptationTesting : ISMTP
|
||||
Tuple<string, CellInstanceVersion> result;
|
||||
CellInstanceVersion cellInstanceVersion;
|
||||
string cellInstanceServiceV2 = string.Concat("http://", _HostNameAndPort, "/CellInstanceServiceV2/", cellInstanceName, "/", cellInstanceVersionName, "/configuration");
|
||||
if (_CellInstanceVersions.ContainsKey(cellInstanceServiceV2))
|
||||
cellInstanceVersion = _CellInstanceVersions[cellInstanceServiceV2];
|
||||
else
|
||||
if (!_CellInstanceVersions.TryGetValue(cellInstanceServiceV2, out cellInstanceVersion))
|
||||
{
|
||||
cellInstanceVersion = GetCellInstanceVersion(cellInstanceServiceV2);
|
||||
_CellInstanceVersions.Add(cellInstanceServiceV2, cellInstanceVersion);
|
||||
@ -401,7 +399,7 @@ public class AdaptationTesting : ISMTP
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!results.Any() || (!string.IsNullOrEmpty(cellInstanceConnectionName) && !results.ContainsKey(cellInstanceConnectionName)))
|
||||
if (results.Count == 0 || (!string.IsNullOrEmpty(cellInstanceConnectionName) && !results.ContainsKey(cellInstanceConnectionName)))
|
||||
throw new Exception("Match not found (check test method name matches Mango)!");
|
||||
return results;
|
||||
}
|
||||
@ -413,9 +411,8 @@ public class AdaptationTesting : ISMTP
|
||||
result = componentModelComponentsIndexes.ElementAt(0).Value;
|
||||
else
|
||||
{
|
||||
if (componentModelComponentsIndexes is null || !componentModelComponentsIndexes.ContainsKey(cellInstanceConnectionName))
|
||||
if (componentModelComponentsIndexes is null || !componentModelComponentsIndexes.TryGetValue(cellInstanceConnectionName, out result))
|
||||
throw new Exception();
|
||||
result = componentModelComponentsIndexes[cellInstanceConnectionName];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -596,7 +593,7 @@ public class AdaptationTesting : ISMTP
|
||||
throw new Exception();
|
||||
_ = stringBuilder.Clear();
|
||||
}
|
||||
if (componentsCellComponentCellComponentEquipmentDictionaryNames.Any() && string.IsNullOrEmpty(cellInstanceVersion.FrozenBy))
|
||||
if (componentsCellComponentCellComponentEquipmentDictionaryNames.Count != 0 && string.IsNullOrEmpty(cellInstanceVersion.FrozenBy))
|
||||
{
|
||||
if (!cellInstanceVersion.CellCommunicatingRule.EndsWith(".Communicating") || !(from l in componentsCellComponentCellComponentEquipmentNames where l == cellInstanceVersion.CellCommunicatingRule.Split('.')[0] select true).Any())
|
||||
throw new Exception($"{methodName} - CellCommunicatingRule not correct in Mango!");
|
||||
@ -648,9 +645,7 @@ public class AdaptationTesting : ISMTP
|
||||
Tuple<string, FileConnectorConfiguration> result;
|
||||
FileConnectorConfiguration fileConnectorConfiguration;
|
||||
string cellInstanceServiceV2With = string.Concat(cellInstanceVersionTuple.Item1, '/', cellInstanceConnectionName);
|
||||
if (_FileConnectorConfigurations.ContainsKey(cellInstanceServiceV2With))
|
||||
fileConnectorConfiguration = _FileConnectorConfigurations[cellInstanceServiceV2With];
|
||||
else
|
||||
if (!_FileConnectorConfigurations.TryGetValue(cellInstanceServiceV2With, out fileConnectorConfiguration))
|
||||
{
|
||||
Dictionary<string, int[]> componentModelComponentsIndexes = GetComponentModelComponentsIndexes(cellInstanceVersionTuple.Item2, cellInstanceConnectionName);
|
||||
int[] cellInstanceConnectionNameIndexes = GetCellInstanceConnectionNameIndexes(cellInstanceConnectionName, componentModelComponentsIndexes);
|
||||
@ -696,9 +691,7 @@ public class AdaptationTesting : ISMTP
|
||||
int[] cellInstanceConnectionNameIndexes = GetCellInstanceConnectionNameIndexes(cellInstanceConnectionName, componentModelComponentsIndexes);
|
||||
ComponentsCellComponentCellComponent componentsCellComponentCellComponent = cellInstanceVersion.ComponentModel.Components[cellInstanceConnectionNameIndexes[0]].Children[cellInstanceConnectionNameIndexes[1]];
|
||||
string equipmentTypeServiceV2 = string.Concat("http://", _HostNameAndPort, "/EquipmentTypeServiceV2/", componentsCellComponentCellComponent.Equipment.EquipmentType.Name, "/", componentsCellComponentCellComponent.Equipment.EquipmentType.Version, "/configuration");
|
||||
if (_EquipmentTypeVersions.ContainsKey(equipmentTypeServiceV2))
|
||||
equipmentTypeVersion = _EquipmentTypeVersions[equipmentTypeServiceV2];
|
||||
else
|
||||
if (!_EquipmentTypeVersions.TryGetValue(equipmentTypeServiceV2, out equipmentTypeVersion))
|
||||
{
|
||||
equipmentTypeVersion = GetEquipmentTypeVersion(equipmentTypeServiceV2);
|
||||
_EquipmentTypeVersions.Add(equipmentTypeServiceV2, equipmentTypeVersion);
|
||||
@ -763,7 +756,7 @@ public class AdaptationTesting : ISMTP
|
||||
string[] results;
|
||||
string equipmentDictionaryName;
|
||||
string equipmentDictionaryVersionName;
|
||||
if (_SkipEquipmentDictionary || equipmentTypeVersion?.EventActionSequences is null || !equipmentTypeVersion.EventActionSequences.Any() || !(from l in equipmentTypeVersion.EventActionSequences where l.HandledEvent.StartsWith("Equipment.FileRead") select 1).Any())
|
||||
if (_SkipEquipmentDictionary || equipmentTypeVersion?.EventActionSequences is null || equipmentTypeVersion.EventActionSequences.Length == 0 || !(from l in equipmentTypeVersion.EventActionSequences where l.HandledEvent.StartsWith("Equipment.FileRead") select 1).Any())
|
||||
{
|
||||
equipmentDictionaryName = string.Empty;
|
||||
equipmentDictionaryVersionName = string.Empty;
|
||||
@ -834,9 +827,7 @@ public class AdaptationTesting : ISMTP
|
||||
equipmentDictionaryVersion = null;
|
||||
else
|
||||
{
|
||||
if (_EquipmentDictionaryVersions.ContainsKey(equipmentDictionaryServiceV2))
|
||||
equipmentDictionaryVersion = _EquipmentDictionaryVersions[equipmentDictionaryServiceV2];
|
||||
else
|
||||
if (!_EquipmentDictionaryVersions.TryGetValue(equipmentDictionaryServiceV2, out equipmentDictionaryVersion))
|
||||
{
|
||||
equipmentDictionaryVersion = GetEquipmentDictionaryVersion(equipmentDictionaryServiceV2);
|
||||
_EquipmentDictionaryVersions.Add(equipmentDictionaryServiceV2, equipmentDictionaryVersion);
|
||||
@ -850,14 +841,15 @@ public class AdaptationTesting : ISMTP
|
||||
{
|
||||
Tuple<string, List<Tuple<string, string>>> result;
|
||||
List<Tuple<string, string>> results;
|
||||
List<Tuple<string, string>> collection;
|
||||
if (_SkipEquipmentDictionary)
|
||||
results = new List<Tuple<string, string>>();
|
||||
else if (string.IsNullOrEmpty(equipmentDictionaryVersionTuple.Item1))
|
||||
throw new Exception();
|
||||
else if (equipmentDictionaryVersionTuple?.Item4?.Events?.Event is null)
|
||||
results = new List<Tuple<string, string>>();
|
||||
else if (_EquipmentDictionaryEventDescriptions.ContainsKey(equipmentDictionaryVersionTuple.Item1))
|
||||
results = _EquipmentDictionaryEventDescriptions[equipmentDictionaryVersionTuple.Item1];
|
||||
else if (_EquipmentDictionaryEventDescriptions.TryGetValue(equipmentDictionaryVersionTuple.Item1, out collection))
|
||||
results = collection;
|
||||
else
|
||||
{
|
||||
results = new List<Tuple<string, string>>();
|
||||
@ -963,25 +955,33 @@ public class AdaptationTesting : ISMTP
|
||||
}
|
||||
if (_TestContext.FullyQualifiedTestClassName.Contains(nameof(Extract)))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation))
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation))
|
||||
_ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation);
|
||||
if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation))
|
||||
{
|
||||
if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation))
|
||||
_ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.ErrorTargetFileLocation);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.SourceFileLocation))
|
||||
{
|
||||
if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.SourceFileLocation))
|
||||
_ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.SourceFileLocation);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.TargetFileLocation))
|
||||
{
|
||||
if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.TargetFileLocation))
|
||||
_ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.TargetFileLocation);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder))
|
||||
{
|
||||
if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder))
|
||||
_ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder);
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.SourceFileLocation))
|
||||
catch (IOException ex)
|
||||
{
|
||||
if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.SourceFileLocation))
|
||||
_ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.SourceFileLocation);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.TargetFileLocation))
|
||||
{
|
||||
if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.TargetFileLocation))
|
||||
_ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.TargetFileLocation);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder))
|
||||
{
|
||||
if (!Directory.Exists(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder))
|
||||
_ = Directory.CreateDirectory(fileConnectorConfigurationTuple.Item2.AlternateTargetFolder);
|
||||
if (!ex.Message.Contains("SMB1"))
|
||||
throw;
|
||||
}
|
||||
}
|
||||
result = FileHandlers.CellInstanceConnectionName.Get(this, fileParameter, mbn.CellInstanceName, mbn.CellInstanceConnectionName, fileConnectorConfigurationTuple.Item2, equipmentTypeVersionTuple.Item2, parameterizedModelObjectDefinitionTypeTuple.Item2, modelObjectParametersTuple.Item2, equipmentDictionaryVersionTuple.Item2, dummyRuns, staticRuns, useCyclicalForDescription, connectionCount: cellInstanceVersionTuple.Item2.EquipmentConnections.Length);
|
||||
@ -1001,7 +1001,7 @@ public class AdaptationTesting : ISMTP
|
||||
string sourceFileLocation = string.Empty;
|
||||
MethodBaseName mbn = GetMethodBaseName(methodBase);
|
||||
string[] textFiles = GetTextFiles(mbn);
|
||||
if (!textFiles.Any())
|
||||
if (textFiles.Length == 0)
|
||||
{
|
||||
if (_HasWaitForProperty)
|
||||
throw new Exception("Set text file!");
|
||||
@ -1065,7 +1065,7 @@ public class AdaptationTesting : ISMTP
|
||||
else
|
||||
{
|
||||
string[] files = Directory.GetFiles(ipdsfDirectory, searchPattern, SearchOption.TopDirectoryOnly);
|
||||
if (files.Any())
|
||||
if (files.Length != 0)
|
||||
ipdsfFile = files[0];
|
||||
else
|
||||
ipdsfFile = searchPattern;
|
||||
@ -1109,9 +1109,9 @@ public class AdaptationTesting : ISMTP
|
||||
{
|
||||
string[] pdsfFiles;
|
||||
pdsfFiles = Directory.GetFiles(searchDirectory, searchPattern, SearchOption.TopDirectoryOnly);
|
||||
if (!pdsfFiles.Any())
|
||||
if (pdsfFiles.Length == 0)
|
||||
_ = Process.Start("explorer.exe", searchDirectory);
|
||||
Assert.IsTrue(pdsfFiles.Any(), "GetFiles check");
|
||||
Assert.IsTrue(pdsfFiles.Length != 0, "GetFiles check");
|
||||
results = GetLogisticsColumnsAndBody(pdsfFiles[0]);
|
||||
}
|
||||
Assert.IsFalse(string.IsNullOrEmpty(results.Item1));
|
||||
|
@ -2,7 +2,6 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
@ -75,7 +74,7 @@ public class UnitTesting
|
||||
if (string.IsNullOrEmpty(result))
|
||||
break;
|
||||
checkFiles = Directory.GetFiles(result, "*.Tests.*proj", SearchOption.TopDirectoryOnly);
|
||||
if (checkFiles.Any())
|
||||
if (checkFiles.Length != 0)
|
||||
break;
|
||||
result = Path.GetDirectoryName(result);
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
@ -73,7 +75,10 @@ public class BACKLOG : LoggingUnitTesting, IDisposable
|
||||
cellInstanceVersion = AdaptationTesting.GetCellInstanceVersion($"{development}/{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"));
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
@ -86,8 +91,8 @@ public class BACKLOG : LoggingUnitTesting, IDisposable
|
||||
StringBuilder results = new();
|
||||
(string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[]
|
||||
{
|
||||
new("BACKLOG", "v2.49.2"),
|
||||
new("BACKLOG-EQPT", "v2.49.2"),
|
||||
new("BACKLOG", "v2.52.0"),
|
||||
new("BACKLOG-EQPT", "v2.52.0"),
|
||||
};
|
||||
string staging = "http://mestsa07ec.infineon.com:9003/CellInstanceServiceV2";
|
||||
Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion;
|
||||
@ -97,7 +102,30 @@ public class BACKLOG : 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"));
|
||||
NonThrowTryCatch();
|
||||
}
|
||||
|
||||
[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();
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
@ -24,6 +26,13 @@ public class MESAFIBACKLOG : LoggingUnitTesting, IDisposable
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
private static void NonThrowTryCatch()
|
||||
{
|
||||
try
|
||||
{ throw new Exception(); }
|
||||
catch (Exception) { }
|
||||
}
|
||||
|
||||
public MESAFIBACKLOG(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType)
|
||||
{
|
||||
}
|
||||
@ -55,7 +64,7 @@ public class MESAFIBACKLOG : LoggingUnitTesting, IDisposable
|
||||
StringBuilder results = new();
|
||||
(string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[]
|
||||
{
|
||||
new("MESAFIBACKLOG", "v2.49.2"),
|
||||
new("MESAFIBACKLOG", "v2.52.0"),
|
||||
};
|
||||
string development = "http://eaf-dev.mes.infineon.com:9003/CellInstanceServiceV2";
|
||||
Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion;
|
||||
@ -65,7 +74,10 @@ public class MESAFIBACKLOG : LoggingUnitTesting, IDisposable
|
||||
cellInstanceVersion = AdaptationTesting.GetCellInstanceVersion($"{development}/{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"));
|
||||
}
|
||||
|
||||
@ -87,8 +99,31 @@ public class MESAFIBACKLOG : 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