Thickness01-Thickness14
v2_52_0-Tests editorconfig net8.0
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);
|
||||
@ -401,7 +401,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;
|
||||
}
|
||||
@ -596,7 +596,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!");
|
||||
@ -763,7 +763,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;
|
||||
@ -963,25 +963,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 +1009,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 +1073,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 +1117,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;
|
||||
@ -74,7 +73,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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user