Ready to test v2.39.0
This commit is contained in:
@ -7,60 +7,55 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
||||
namespace _Tests.CreateSelfDescription.Staging.v2_36_3;
|
||||
|
||||
[TestClass]
|
||||
public class BIORAD2 : EAFLoggingUnitTesting
|
||||
{
|
||||
internal static BIORAD2 EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
[TestClass]
|
||||
public class BIORAD2 : EAFLoggingUnitTesting
|
||||
public BIORAD2() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
private static BIORAD2 _EAFLoggingUnitTesting;
|
||||
internal static BIORAD2 EAFLoggingUnitTesting => _EAFLoggingUnitTesting;
|
||||
public BIORAD2(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
public BIORAD2() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (_EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
EAFLoggingUnitTesting = new BIORAD2(testContext);
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
||||
string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
||||
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
||||
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
||||
}
|
||||
|
||||
public BIORAD2(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
if (_EAFLoggingUnitTesting is null)
|
||||
_EAFLoggingUnitTesting = new BIORAD2(testContext);
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
||||
string[] fileNameAndText = _EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
||||
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
||||
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
||||
}
|
||||
|
||||
[ClassCleanup()]
|
||||
public static void ClassCleanup()
|
||||
{
|
||||
if (!(_EAFLoggingUnitTesting.Logger is null))
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
||||
if (!(_EAFLoggingUnitTesting is null))
|
||||
_EAFLoggingUnitTesting.Dispose();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__BIORAD2__QS408M()
|
||||
{
|
||||
string check = "*.txt";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
[ClassCleanup()]
|
||||
public static void ClassCleanup()
|
||||
{
|
||||
if (EAFLoggingUnitTesting.Logger is not null)
|
||||
EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
||||
if (EAFLoggingUnitTesting is not null)
|
||||
EAFLoggingUnitTesting.Dispose();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__BIORAD2__QS408M()
|
||||
{
|
||||
string check = "*.txt";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,60 +7,55 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
||||
namespace _Tests.CreateSelfDescription.Staging.v2_36_3;
|
||||
|
||||
[TestClass]
|
||||
public class BIORAD3 : EAFLoggingUnitTesting
|
||||
{
|
||||
internal static BIORAD3 EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
[TestClass]
|
||||
public class BIORAD3 : EAFLoggingUnitTesting
|
||||
public BIORAD3() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
private static BIORAD3 _EAFLoggingUnitTesting;
|
||||
internal static BIORAD3 EAFLoggingUnitTesting => _EAFLoggingUnitTesting;
|
||||
public BIORAD3(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
public BIORAD3() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (_EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
EAFLoggingUnitTesting = new BIORAD3(testContext);
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
||||
string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
||||
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
||||
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
||||
}
|
||||
|
||||
public BIORAD3(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
if (_EAFLoggingUnitTesting is null)
|
||||
_EAFLoggingUnitTesting = new BIORAD3(testContext);
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
||||
string[] fileNameAndText = _EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
||||
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
||||
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
||||
}
|
||||
|
||||
[ClassCleanup()]
|
||||
public static void ClassCleanup()
|
||||
{
|
||||
if (!(_EAFLoggingUnitTesting.Logger is null))
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
||||
if (!(_EAFLoggingUnitTesting is null))
|
||||
_EAFLoggingUnitTesting.Dispose();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__BIORAD3__QS408M()
|
||||
{
|
||||
string check = "*.txt";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
[ClassCleanup()]
|
||||
public static void ClassCleanup()
|
||||
{
|
||||
if (EAFLoggingUnitTesting.Logger is not null)
|
||||
EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
||||
if (EAFLoggingUnitTesting is not null)
|
||||
EAFLoggingUnitTesting.Dispose();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__BIORAD3__QS408M()
|
||||
{
|
||||
string check = "*.txt";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,172 +7,167 @@ using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace _Tests.CreateSelfDescription.Staging.v2_36_3
|
||||
namespace _Tests.CreateSelfDescription.Staging.v2_36_3;
|
||||
|
||||
[TestClass]
|
||||
public class MET08THFTIRQS408M : EAFLoggingUnitTesting
|
||||
{
|
||||
internal static MET08THFTIRQS408M EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
[TestClass]
|
||||
public class MET08THFTIRQS408M : EAFLoggingUnitTesting
|
||||
public MET08THFTIRQS408M() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
private static MET08THFTIRQS408M _EAFLoggingUnitTesting;
|
||||
internal static MET08THFTIRQS408M EAFLoggingUnitTesting => _EAFLoggingUnitTesting;
|
||||
public MET08THFTIRQS408M(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
public MET08THFTIRQS408M() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (_EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
EAFLoggingUnitTesting = new MET08THFTIRQS408M(testContext);
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
||||
string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
||||
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
||||
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
||||
}
|
||||
|
||||
public MET08THFTIRQS408M(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
[ClassCleanup()]
|
||||
public static void ClassCleanup()
|
||||
{
|
||||
if (EAFLoggingUnitTesting.Logger is not null)
|
||||
EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
||||
if (EAFLoggingUnitTesting is not null)
|
||||
EAFLoggingUnitTesting.Dispose();
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
if (_EAFLoggingUnitTesting is null)
|
||||
_EAFLoggingUnitTesting = new MET08THFTIRQS408M(testContext);
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
||||
string[] fileNameAndText = _EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
||||
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
||||
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
||||
}
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M()
|
||||
{
|
||||
string check = "~IsXToOpenInsightMetrologyViewer";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[ClassCleanup()]
|
||||
public static void ClassCleanup()
|
||||
{
|
||||
if (!(_EAFLoggingUnitTesting.Logger is null))
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
||||
if (!(_EAFLoggingUnitTesting is null))
|
||||
_EAFLoggingUnitTesting.Dispose();
|
||||
}
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_()
|
||||
{
|
||||
string check = "~IsXToIQSSi";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M()
|
||||
{
|
||||
string check = "~IsXToOpenInsightMetrologyViewer";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M__()
|
||||
{
|
||||
string check = "~IsXToOpenInsight";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_()
|
||||
{
|
||||
string check = "~IsXToIQSSi";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M___()
|
||||
{
|
||||
string check = "~IsXToOpenInsightMetrologyViewerAttachments";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M__()
|
||||
{
|
||||
string check = "~IsXToOpenInsight";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M____()
|
||||
{
|
||||
string check = "~IsXToAPC";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M___()
|
||||
{
|
||||
string check = "~IsXToOpenInsightMetrologyViewerAttachments";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_____()
|
||||
{
|
||||
string check = "~IsXToSPaCe";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M____()
|
||||
{
|
||||
string check = "~IsXToAPC";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M______()
|
||||
{
|
||||
string check = "~IsXToArchive";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_____()
|
||||
{
|
||||
string check = "~IsXToSPaCe";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M______()
|
||||
{
|
||||
string check = "~IsXToArchive";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_______()
|
||||
{
|
||||
string check = "~IsArchive";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M________()
|
||||
{
|
||||
string check = "~IsDummy";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = _EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = _EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
_EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_______()
|
||||
{
|
||||
string check = "~IsArchive";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M________()
|
||||
{
|
||||
string check = "~IsDummy";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,61 @@
|
||||
using Adaptation.Shared.Methods;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Shared;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace _Tests.CreateSelfDescription.Staging.v2_39_0;
|
||||
|
||||
[TestClass]
|
||||
public class BIORAD2 : EAFLoggingUnitTesting
|
||||
{
|
||||
internal static BIORAD2 EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
public BIORAD2() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public BIORAD2(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
EAFLoggingUnitTesting = new BIORAD2(testContext);
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
||||
string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
||||
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
||||
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
||||
}
|
||||
|
||||
[ClassCleanup()]
|
||||
public static void ClassCleanup()
|
||||
{
|
||||
if (EAFLoggingUnitTesting.Logger is not null)
|
||||
EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
||||
if (EAFLoggingUnitTesting is not null)
|
||||
EAFLoggingUnitTesting.Dispose();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__BIORAD2__QS408M()
|
||||
{
|
||||
string check = "*.txt";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
using Adaptation.Shared.Methods;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Shared;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace _Tests.CreateSelfDescription.Staging.v2_39_0;
|
||||
|
||||
[TestClass]
|
||||
public class BIORAD3 : EAFLoggingUnitTesting
|
||||
{
|
||||
internal static BIORAD3 EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
public BIORAD3() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public BIORAD3(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
EAFLoggingUnitTesting = new BIORAD3(testContext);
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
||||
string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
||||
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
||||
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
||||
}
|
||||
|
||||
[ClassCleanup()]
|
||||
public static void ClassCleanup()
|
||||
{
|
||||
if (EAFLoggingUnitTesting.Logger is not null)
|
||||
EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
||||
if (EAFLoggingUnitTesting is not null)
|
||||
EAFLoggingUnitTesting.Dispose();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__BIORAD3__QS408M()
|
||||
{
|
||||
string check = "*.txt";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,173 @@
|
||||
using Adaptation.Shared.Methods;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Shared;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace _Tests.CreateSelfDescription.Staging.v2_39_0;
|
||||
|
||||
[TestClass]
|
||||
public class MET08THFTIRQS408M : EAFLoggingUnitTesting
|
||||
{
|
||||
internal static MET08THFTIRQS408M EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
public MET08THFTIRQS408M() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public MET08THFTIRQS408M(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
EAFLoggingUnitTesting = new MET08THFTIRQS408M(testContext);
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(testContext.TestName, " - ClassInitialize"));
|
||||
string[] fileNameAndText = EAFLoggingUnitTesting.AdaptationTesting.GetCSharpText(testContext.TestName);
|
||||
File.WriteAllText(fileNameAndText[0], fileNameAndText[1]);
|
||||
File.WriteAllText(fileNameAndText[2], fileNameAndText[3]);
|
||||
}
|
||||
|
||||
[ClassCleanup()]
|
||||
public static void ClassCleanup()
|
||||
{
|
||||
if (EAFLoggingUnitTesting.Logger is not null)
|
||||
EAFLoggingUnitTesting.Logger.LogInformation("Cleanup");
|
||||
if (EAFLoggingUnitTesting is not null)
|
||||
EAFLoggingUnitTesting.Dispose();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M()
|
||||
{
|
||||
string check = "~IsXToOpenInsightMetrologyViewer";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M_()
|
||||
{
|
||||
string check = "~IsXToIQSSi";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M__()
|
||||
{
|
||||
string check = "~IsXToOpenInsight";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M___()
|
||||
{
|
||||
string check = "~IsXToOpenInsightMetrologyViewerAttachments";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M____()
|
||||
{
|
||||
string check = "~IsXToAPC";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M_____()
|
||||
{
|
||||
string check = "~IsXToSPaCe";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M______()
|
||||
{
|
||||
string check = "~IsXToArchive";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M_______()
|
||||
{
|
||||
string check = "~IsArchive";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M________()
|
||||
{
|
||||
string check = "~IsDummy";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
string[] fileNameAndJson = EAFLoggingUnitTesting.AdaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
IFileRead fileRead = EAFLoggingUnitTesting.AdaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(fileRead.CellInstanceConnectionName));
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
}
|
@ -1,29 +1,23 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace _Tests.Extract.Staging.v2_36_3
|
||||
namespace _Tests.Extract.Staging.v2_36_3;
|
||||
|
||||
[TestClass]
|
||||
public class BIORAD2
|
||||
{
|
||||
|
||||
[TestClass]
|
||||
public class BIORAD2
|
||||
private static CreateSelfDescription.Staging.v2_36_3.BIORAD2 _BIORAD2;
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
|
||||
private static CreateSelfDescription.Staging.v2_36_3.BIORAD2 _BIORAD2;
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
CreateSelfDescription.Staging.v2_36_3.BIORAD2.ClassInitialize(testContext);
|
||||
_BIORAD2 = CreateSelfDescription.Staging.v2_36_3.BIORAD2.EAFLoggingUnitTesting;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__BIORAD2__QS408M()
|
||||
{
|
||||
_BIORAD2.Staging__v2_36_3__BIORAD2__QS408M();
|
||||
}
|
||||
|
||||
CreateSelfDescription.Staging.v2_36_3.BIORAD2.ClassInitialize(testContext);
|
||||
_BIORAD2 = CreateSelfDescription.Staging.v2_36_3.BIORAD2.EAFLoggingUnitTesting;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__BIORAD2__QS408M() => _BIORAD2.Staging__v2_36_3__BIORAD2__QS408M();
|
||||
|
||||
}
|
||||
|
||||
// dotnet build --runtime win-x64
|
||||
|
@ -8,58 +8,52 @@ using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace _Tests.Extract.Staging.v2_36_3
|
||||
namespace _Tests.Extract.Staging.v2_36_3;
|
||||
|
||||
[TestClass]
|
||||
public class BIORAD3
|
||||
{
|
||||
|
||||
[TestClass]
|
||||
public class BIORAD3
|
||||
private static CreateSelfDescription.Staging.v2_36_3.BIORAD3 _BIORAD3;
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
CreateSelfDescription.Staging.v2_36_3.BIORAD3.ClassInitialize(testContext);
|
||||
_BIORAD3 = CreateSelfDescription.Staging.v2_36_3.BIORAD3.EAFLoggingUnitTesting;
|
||||
}
|
||||
|
||||
private static CreateSelfDescription.Staging.v2_36_3.BIORAD3 _BIORAD3;
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
CreateSelfDescription.Staging.v2_36_3.BIORAD3.ClassInitialize(testContext);
|
||||
_BIORAD3 = CreateSelfDescription.Staging.v2_36_3.BIORAD3.EAFLoggingUnitTesting;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__BIORAD3__QS408M()
|
||||
{
|
||||
_BIORAD3.Staging__v2_36_3__BIORAD3__QS408M();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__BIORAD3__QS408M637406016892454000__ReactorAndRDS()
|
||||
{
|
||||
DateTime dateTime;
|
||||
string check = "*.txt";
|
||||
_BIORAD3.Staging__v2_36_3__BIORAD3__QS408M();
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
string[] variables = _BIORAD3.AdaptationTesting.GetVariables(methodBase, check);
|
||||
Tuple<string, string[], string[]> pdsf = Helpers.Metrology.GetLogisticsColumnsAndBody(variables[2], variables[4]);
|
||||
IFileRead fileRead = _BIORAD3.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResult = fileRead.ReExtract();
|
||||
Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1));
|
||||
Assert.IsTrue(extractResult.Item3.Length > 0, "extractResult Array Length check!");
|
||||
Assert.IsNotNull(extractResult.Item4);
|
||||
Logistics logistics = new Logistics(fileRead);
|
||||
dateTime = Adaptation.FileHandlers.QS408M.ProcessData.GetDateTime(logistics, string.Empty);
|
||||
Assert.IsTrue(dateTime == logistics.DateTimeFromSequence);
|
||||
dateTime = Adaptation.FileHandlers.QS408M.ProcessData.GetDateTime(logistics, "Tue Nov 10 12:03:56 1970");
|
||||
Assert.IsTrue(dateTime == logistics.DateTimeFromSequence);
|
||||
Tuple<string, string[], string[]> pdsfNew = Helpers.Metrology.GetLogisticsColumnsAndBody(fileRead, logistics, extractResult, pdsf);
|
||||
Helpers.Metrology.CompareSave(variables[5], pdsf, pdsfNew);
|
||||
string[] json = Helpers.Metrology.GetItem2(pdsf, pdsfNew);
|
||||
Helpers.Metrology.CompareSaveJSON(variables[5], json);
|
||||
Assert.IsTrue(json[0] == json[1], "Item2 check!");
|
||||
string[] join = Helpers.Metrology.GetItem3(pdsf, pdsfNew);
|
||||
Helpers.Metrology.CompareSaveTSV(variables[5], join);
|
||||
Assert.IsTrue(join[0] == join[1], "Item3 (Join) check!");
|
||||
Helpers.Metrology.UpdatePassDirectory(variables[2]);
|
||||
}
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__BIORAD3__QS408M() => _BIORAD3.Staging__v2_36_3__BIORAD3__QS408M();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__BIORAD3__QS408M637406016892454000__ReactorAndRDS()
|
||||
{
|
||||
DateTime dateTime;
|
||||
string check = "*.txt";
|
||||
_BIORAD3.Staging__v2_36_3__BIORAD3__QS408M();
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
string[] variables = _BIORAD3.AdaptationTesting.GetVariables(methodBase, check);
|
||||
Tuple<string, string[], string[]> pdsf = Helpers.Metrology.GetLogisticsColumnsAndBody(variables[2], variables[4]);
|
||||
IFileRead fileRead = _BIORAD3.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResult = fileRead.ReExtract();
|
||||
Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1));
|
||||
Assert.IsTrue(extractResult.Item3.Length > 0, "extractResult Array Length check!");
|
||||
Assert.IsNotNull(extractResult.Item4);
|
||||
Logistics logistics = new(fileRead);
|
||||
dateTime = Adaptation.FileHandlers.QS408M.ProcessData.GetDateTime(logistics, string.Empty);
|
||||
Assert.IsTrue(dateTime == logistics.DateTimeFromSequence);
|
||||
dateTime = Adaptation.FileHandlers.QS408M.ProcessData.GetDateTime(logistics, "Tue Nov 10 12:03:56 1970");
|
||||
Assert.IsTrue(dateTime == logistics.DateTimeFromSequence);
|
||||
Tuple<string, string[], string[]> pdsfNew = Helpers.Metrology.GetLogisticsColumnsAndBody(fileRead, logistics, extractResult, pdsf);
|
||||
Helpers.Metrology.CompareSave(variables[5], pdsf, pdsfNew);
|
||||
string[] json = Helpers.Metrology.GetItem2(pdsf, pdsfNew);
|
||||
Helpers.Metrology.CompareSaveJSON(variables[5], json);
|
||||
Assert.IsTrue(json[0] == json[1], "Item2 check!");
|
||||
string[] join = Helpers.Metrology.GetItem3(pdsf, pdsfNew);
|
||||
Helpers.Metrology.CompareSaveTSV(variables[5], join);
|
||||
Assert.IsTrue(join[0] == join[1], "Item3 (Join) check!");
|
||||
Helpers.Metrology.UpdatePassDirectory(variables[2]);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,77 +1,47 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace _Tests.Extract.Staging.v2_36_3
|
||||
namespace _Tests.Extract.Staging.v2_36_3;
|
||||
|
||||
[TestClass]
|
||||
public class MET08THFTIRQS408M
|
||||
{
|
||||
|
||||
[TestClass]
|
||||
public class MET08THFTIRQS408M
|
||||
private static CreateSelfDescription.Staging.v2_36_3.MET08THFTIRQS408M _MET08THFTIRQS408M;
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
|
||||
private static CreateSelfDescription.Staging.v2_36_3.MET08THFTIRQS408M _MET08THFTIRQS408M;
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
CreateSelfDescription.Staging.v2_36_3.MET08THFTIRQS408M.ClassInitialize(testContext);
|
||||
_MET08THFTIRQS408M = CreateSelfDescription.Staging.v2_36_3.MET08THFTIRQS408M.EAFLoggingUnitTesting;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M()
|
||||
{
|
||||
_MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_()
|
||||
{
|
||||
_MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M__()
|
||||
{
|
||||
_MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M__();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M___()
|
||||
{
|
||||
_MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M___();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M____()
|
||||
{
|
||||
_MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M____();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_____()
|
||||
{
|
||||
_MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_____();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M______()
|
||||
{
|
||||
_MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M______();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_______()
|
||||
{
|
||||
_MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_______();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M________()
|
||||
{
|
||||
_MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M________();
|
||||
}
|
||||
|
||||
CreateSelfDescription.Staging.v2_36_3.MET08THFTIRQS408M.ClassInitialize(testContext);
|
||||
_MET08THFTIRQS408M = CreateSelfDescription.Staging.v2_36_3.MET08THFTIRQS408M.EAFLoggingUnitTesting;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M() => _MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_() => _MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M__() => _MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M__();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M___() => _MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M___();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M____() => _MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M____();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_____() => _MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_____();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M______() => _MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M______();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_______() => _MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M_______();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M________() => _MET08THFTIRQS408M.Staging__v2_36_3__MET08THFTIRQS408M__MET08THFTIRQS408M________();
|
||||
|
||||
}
|
||||
|
||||
// dotnet build --runtime win-x64
|
||||
|
21
Adaptation/_Tests/Extract/Staging/v2.39.0/BIORAD2.cs
Normal file
21
Adaptation/_Tests/Extract/Staging/v2.39.0/BIORAD2.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace _Tests.Extract.Staging.v2_39_0;
|
||||
|
||||
[TestClass]
|
||||
public class BIORAD2
|
||||
{
|
||||
|
||||
private static CreateSelfDescription.Staging.v2_39_0.BIORAD2 _BIORAD2;
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
CreateSelfDescription.Staging.v2_39_0.BIORAD2.ClassInitialize(testContext);
|
||||
_BIORAD2 = CreateSelfDescription.Staging.v2_39_0.BIORAD2.EAFLoggingUnitTesting;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__BIORAD2__QS408M() => _BIORAD2.Staging__v2_39_0__BIORAD2__QS408M();
|
||||
|
||||
}
|
59
Adaptation/_Tests/Extract/Staging/v2.39.0/BIORAD3.cs
Normal file
59
Adaptation/_Tests/Extract/Staging/v2.39.0/BIORAD3.cs
Normal file
@ -0,0 +1,59 @@
|
||||
using Adaptation.Shared;
|
||||
using Adaptation.Shared.Methods;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace _Tests.Extract.Staging.v2_39_0;
|
||||
|
||||
[TestClass]
|
||||
public class BIORAD3
|
||||
{
|
||||
|
||||
private static CreateSelfDescription.Staging.v2_39_0.BIORAD3 _BIORAD3;
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
CreateSelfDescription.Staging.v2_39_0.BIORAD3.ClassInitialize(testContext);
|
||||
_BIORAD3 = CreateSelfDescription.Staging.v2_39_0.BIORAD3.EAFLoggingUnitTesting;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__BIORAD3__QS408M() => _BIORAD3.Staging__v2_39_0__BIORAD3__QS408M();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__BIORAD3__QS408M637406016892454000__ReactorAndRDS()
|
||||
{
|
||||
DateTime dateTime;
|
||||
string check = "*.txt";
|
||||
_BIORAD3.Staging__v2_39_0__BIORAD3__QS408M();
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
string[] variables = _BIORAD3.AdaptationTesting.GetVariables(methodBase, check);
|
||||
Tuple<string, string[], string[]> pdsf = Helpers.Metrology.GetLogisticsColumnsAndBody(variables[2], variables[4]);
|
||||
IFileRead fileRead = _BIORAD3.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
||||
Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResult = fileRead.ReExtract();
|
||||
Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1));
|
||||
Assert.IsTrue(extractResult.Item3.Length > 0, "extractResult Array Length check!");
|
||||
Assert.IsNotNull(extractResult.Item4);
|
||||
Logistics logistics = new(fileRead);
|
||||
dateTime = Adaptation.FileHandlers.QS408M.ProcessData.GetDateTime(logistics, string.Empty);
|
||||
Assert.IsTrue(dateTime == logistics.DateTimeFromSequence);
|
||||
dateTime = Adaptation.FileHandlers.QS408M.ProcessData.GetDateTime(logistics, "Tue Nov 10 12:03:56 1970");
|
||||
Assert.IsTrue(dateTime == logistics.DateTimeFromSequence);
|
||||
Tuple<string, string[], string[]> pdsfNew = Helpers.Metrology.GetLogisticsColumnsAndBody(fileRead, logistics, extractResult, pdsf);
|
||||
Helpers.Metrology.CompareSave(variables[5], pdsf, pdsfNew);
|
||||
string[] json = Helpers.Metrology.GetItem2(pdsf, pdsfNew);
|
||||
Helpers.Metrology.CompareSaveJSON(variables[5], json);
|
||||
Assert.IsTrue(json[0] == json[1], "Item2 check!");
|
||||
string[] join = Helpers.Metrology.GetItem3(pdsf, pdsfNew);
|
||||
Helpers.Metrology.CompareSaveTSV(variables[5], join);
|
||||
Assert.IsTrue(join[0] == join[1], "Item3 (Join) check!");
|
||||
Helpers.Metrology.UpdatePassDirectory(variables[2]);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace _Tests.Extract.Staging.v2_39_0;
|
||||
|
||||
[TestClass]
|
||||
public class MET08THFTIRQS408M
|
||||
{
|
||||
|
||||
private static CreateSelfDescription.Staging.v2_39_0.MET08THFTIRQS408M _MET08THFTIRQS408M;
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
CreateSelfDescription.Staging.v2_39_0.MET08THFTIRQS408M.ClassInitialize(testContext);
|
||||
_MET08THFTIRQS408M = CreateSelfDescription.Staging.v2_39_0.MET08THFTIRQS408M.EAFLoggingUnitTesting;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M() => _MET08THFTIRQS408M.Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M_() => _MET08THFTIRQS408M.Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M_();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M__() => _MET08THFTIRQS408M.Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M__();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M___() => _MET08THFTIRQS408M.Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M___();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M____() => _MET08THFTIRQS408M.Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M____();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M_____() => _MET08THFTIRQS408M.Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M_____();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M______() => _MET08THFTIRQS408M.Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M______();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M_______() => _MET08THFTIRQS408M.Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M_______();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M________() => _MET08THFTIRQS408M.Staging__v2_39_0__MET08THFTIRQS408M__MET08THFTIRQS408M________();
|
||||
|
||||
}
|
@ -9,152 +9,148 @@ using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace _Tests.Helpers
|
||||
namespace _Tests.Helpers;
|
||||
|
||||
public class Metrology
|
||||
{
|
||||
|
||||
public class Metrology
|
||||
internal static Tuple<string, string[], string[]> GetLogisticsColumnsAndBody(string fileFullName)
|
||||
{
|
||||
Tuple<string, string[], string[]> results;
|
||||
results = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(fileFullName);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(results.Item1));
|
||||
Assert.IsTrue(results.Item2.Length > 0, "Column check");
|
||||
Assert.IsTrue(results.Item3.Length > 0, "Body check");
|
||||
return results;
|
||||
}
|
||||
|
||||
internal static Tuple<string, string[], string[]> GetLogisticsColumnsAndBody(string fileFullName)
|
||||
internal static Tuple<string, string[], string[]> GetLogisticsColumnsAndBody(string searchDirectory, string searchPattern)
|
||||
{
|
||||
Tuple<string, string[], string[]> results;
|
||||
if (searchPattern.Length > 3 && !searchPattern.Contains('*') && File.Exists(searchPattern))
|
||||
results = GetLogisticsColumnsAndBody(searchPattern);
|
||||
else
|
||||
{
|
||||
Tuple<string, string[], string[]> results;
|
||||
results = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(fileFullName);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(results.Item1));
|
||||
Assert.IsTrue(results.Item2.Length > 0, "Column check");
|
||||
Assert.IsTrue(results.Item3.Length > 0, "Body check");
|
||||
return results;
|
||||
string[] pdsfFiles;
|
||||
pdsfFiles = Directory.GetFiles(searchDirectory, searchPattern, SearchOption.TopDirectoryOnly);
|
||||
if (!pdsfFiles.Any())
|
||||
_ = Process.Start("explorer.exe", searchDirectory);
|
||||
Assert.IsTrue(pdsfFiles.Any(), "GetFiles check");
|
||||
results = GetLogisticsColumnsAndBody(pdsfFiles[0]);
|
||||
}
|
||||
Assert.IsFalse(string.IsNullOrEmpty(results.Item1));
|
||||
Assert.IsTrue(results.Item2.Length > 0, "Column check");
|
||||
Assert.IsTrue(results.Item3.Length > 0, "Body check");
|
||||
return results;
|
||||
}
|
||||
|
||||
internal static Tuple<string, string[], string[]> GetLogisticsColumnsAndBody(string searchDirectory, string searchPattern)
|
||||
{
|
||||
Tuple<string, string[], string[]> results;
|
||||
if (searchPattern.Length > 3 && !searchPattern.Contains('*') && File.Exists(searchPattern))
|
||||
results = GetLogisticsColumnsAndBody(searchPattern);
|
||||
else
|
||||
{
|
||||
string[] pdsfFiles;
|
||||
pdsfFiles = Directory.GetFiles(searchDirectory, searchPattern, SearchOption.TopDirectoryOnly);
|
||||
if (!pdsfFiles.Any())
|
||||
Process.Start("explorer.exe", searchDirectory);
|
||||
Assert.IsTrue(pdsfFiles.Any(), "GetFiles check");
|
||||
results = GetLogisticsColumnsAndBody(pdsfFiles[0]);
|
||||
}
|
||||
Assert.IsFalse(string.IsNullOrEmpty(results.Item1));
|
||||
Assert.IsTrue(results.Item2.Length > 0, "Column check");
|
||||
Assert.IsTrue(results.Item3.Length > 0, "Body check");
|
||||
return results;
|
||||
}
|
||||
internal static Tuple<string, string[], string[]> GetLogisticsColumnsAndBody(IFileRead fileRead, Logistics logistics, Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResult, Tuple<string, string[], string[]> pdsf)
|
||||
{
|
||||
Tuple<string, string[], string[]> results;
|
||||
string text = ProcessDataStandardFormat.GetPDSFText(fileRead, logistics, extractResult.Item3, logisticsText: pdsf.Item1);
|
||||
string[] lines = text.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
|
||||
results = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(logistics.ReportFullPath, lines);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(results.Item1));
|
||||
Assert.IsTrue(results.Item2.Length > 0, "Column check");
|
||||
Assert.IsTrue(results.Item3.Length > 0, "Body check");
|
||||
return results;
|
||||
}
|
||||
|
||||
internal static Tuple<string, string[], string[]> GetLogisticsColumnsAndBody(IFileRead fileRead, Logistics logistics, Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResult, Tuple<string, string[], string[]> pdsf)
|
||||
{
|
||||
Tuple<string, string[], string[]> results;
|
||||
string text = ProcessDataStandardFormat.GetPDSFText(fileRead, logistics, extractResult.Item3, logisticsText: pdsf.Item1);
|
||||
string[] lines = text.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
|
||||
results = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(logistics.ReportFullPath, lines);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(results.Item1));
|
||||
Assert.IsTrue(results.Item2.Length > 0, "Column check");
|
||||
Assert.IsTrue(results.Item3.Length > 0, "Body check");
|
||||
return results;
|
||||
}
|
||||
internal static string[] GetItem2(Tuple<string, string[], string[]> pdsf, Tuple<string, string[], string[]> pdsfNew)
|
||||
{
|
||||
JsonSerializerOptions jsonSerializerOptions = new() { WriteIndented = true };
|
||||
string jsonOld = JsonSerializer.Serialize(pdsf.Item2, pdsf.Item2.GetType(), jsonSerializerOptions);
|
||||
string jsonNew = JsonSerializer.Serialize(pdsfNew.Item2, pdsfNew.Item2.GetType(), jsonSerializerOptions);
|
||||
return new string[] { jsonOld, jsonNew };
|
||||
}
|
||||
|
||||
internal static string[] GetItem2(Tuple<string, string[], string[]> pdsf, Tuple<string, string[], string[]> pdsfNew)
|
||||
{
|
||||
JsonSerializerOptions jsonSerializerOptions = new JsonSerializerOptions() { WriteIndented = true };
|
||||
string jsonOld = JsonSerializer.Serialize(pdsf.Item2, pdsf.Item2.GetType(), jsonSerializerOptions);
|
||||
string jsonNew = JsonSerializer.Serialize(pdsfNew.Item2, pdsfNew.Item2.GetType(), jsonSerializerOptions);
|
||||
return new string[] { jsonOld, jsonNew };
|
||||
}
|
||||
internal static string[] GetItem3(Tuple<string, string[], string[]> pdsf, Tuple<string, string[], string[]> pdsfNew)
|
||||
{
|
||||
string joinOld = string.Join(Environment.NewLine, from l in pdsf.Item3 select string.Join('\t', from t in l.Split('\t') where !t.Contains(@"\\") select t));
|
||||
string joinNew = string.Join(Environment.NewLine, from l in pdsfNew.Item3 select string.Join('\t', from t in l.Split('\t') where !t.Contains(@"\\") select t));
|
||||
return new string[] { joinOld, joinNew };
|
||||
}
|
||||
|
||||
internal static string[] GetItem3(Tuple<string, string[], string[]> pdsf, Tuple<string, string[], string[]> pdsfNew)
|
||||
internal static void UpdatePassDirectory(string searchDirectory)
|
||||
{
|
||||
DateTime dateTime = DateTime.Now;
|
||||
try
|
||||
{ Directory.SetLastWriteTime(searchDirectory, dateTime); }
|
||||
catch (System.Exception) { }
|
||||
string ticksDirectory = Path.GetDirectoryName(searchDirectory);
|
||||
try
|
||||
{ Directory.SetLastWriteTime(ticksDirectory, dateTime); }
|
||||
catch (System.Exception) { }
|
||||
string[] directories = Directory.GetDirectories(searchDirectory, "*", SearchOption.TopDirectoryOnly);
|
||||
foreach (string directory in directories)
|
||||
{
|
||||
string joinOld = string.Join(Environment.NewLine, from l in pdsf.Item3 select string.Join('\t', from t in l.Split('\t') where !t.Contains(@"\\") select t));
|
||||
string joinNew = string.Join(Environment.NewLine, from l in pdsfNew.Item3 select string.Join('\t', from t in l.Split('\t') where !t.Contains(@"\\") select t));
|
||||
return new string[] { joinOld, joinNew };
|
||||
}
|
||||
|
||||
internal static void UpdatePassDirectory(string searchDirectory)
|
||||
{
|
||||
DateTime dateTime = DateTime.Now;
|
||||
try
|
||||
{ Directory.SetLastWriteTime(searchDirectory, dateTime); }
|
||||
{ Directory.SetLastWriteTime(directory, dateTime); }
|
||||
catch (System.Exception) { }
|
||||
string ticksDirectory = Path.GetDirectoryName(searchDirectory);
|
||||
try
|
||||
{ Directory.SetLastWriteTime(ticksDirectory, dateTime); }
|
||||
catch (System.Exception) { }
|
||||
string[] directories = Directory.GetDirectories(searchDirectory, "*", SearchOption.TopDirectoryOnly);
|
||||
foreach (string directory in directories)
|
||||
{
|
||||
try
|
||||
{ Directory.SetLastWriteTime(directory, dateTime); }
|
||||
catch (System.Exception) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal static string GetFileName(MethodBase methodBase)
|
||||
internal static string GetFileName(MethodBase methodBase)
|
||||
{
|
||||
string result;
|
||||
string connectionName;
|
||||
string seperator = "__";
|
||||
string connectionNameAndTicks;
|
||||
string[] segments = methodBase.Name.Split(new string[] { seperator }, StringSplitOptions.None);
|
||||
string environment = segments[0];
|
||||
string rawVersionName = segments[1];
|
||||
string equipmentTypeDirectory = segments[2];
|
||||
string ticks = DateTime.Now.Ticks.ToString();
|
||||
string comment = segments[segments.Length - 1];
|
||||
string versionName = segments[1].Replace('_', '.');
|
||||
string before = string.Concat(environment, seperator, rawVersionName, seperator, equipmentTypeDirectory, seperator);
|
||||
string after = methodBase.Name.Substring(before.Length);
|
||||
if (after.Length < ticks.Length)
|
||||
{
|
||||
string result;
|
||||
string connectionName;
|
||||
string seperator = "__";
|
||||
string connectionNameAndTicks;
|
||||
string[] segments = methodBase.Name.Split(new string[] { seperator }, StringSplitOptions.None);
|
||||
string environment = segments[0];
|
||||
string rawVersionName = segments[1];
|
||||
string equipmentTypeDirectory = segments[2];
|
||||
string ticks = DateTime.Now.Ticks.ToString();
|
||||
string comment = segments[segments.Length - 1];
|
||||
string versionName = segments[1].Replace('_', '.');
|
||||
string before = string.Concat(environment, seperator, rawVersionName, seperator, equipmentTypeDirectory, seperator);
|
||||
string after = methodBase.Name.Substring(before.Length);
|
||||
if (after.Length < ticks.Length)
|
||||
{
|
||||
connectionName = after;
|
||||
connectionNameAndTicks = ticks;
|
||||
}
|
||||
else
|
||||
{
|
||||
connectionNameAndTicks = after.Substring(0, after.Length - 2 - comment.Length);
|
||||
connectionName = connectionNameAndTicks.Substring(0, connectionNameAndTicks.Length - ticks.Length);
|
||||
ticks = connectionNameAndTicks.Substring(connectionName.Length);
|
||||
}
|
||||
result = Path.Combine(environment, equipmentTypeDirectory, versionName, $"{environment}__{rawVersionName}__{equipmentTypeDirectory}__{connectionName}", ticks, $"{connectionName.Replace('_', '-')}.json");
|
||||
if (result.Contains('/'))
|
||||
result = string.Concat('/', result);
|
||||
else
|
||||
result = string.Concat('\\', result);
|
||||
return result;
|
||||
connectionName = after;
|
||||
}
|
||||
|
||||
internal static void CompareSaveTSV(string textFileDirectory, string[] join)
|
||||
else
|
||||
{
|
||||
if (join[0] != join[1])
|
||||
{
|
||||
Process.Start("explorer.exe", textFileDirectory);
|
||||
File.WriteAllText(Path.Combine(textFileDirectory, "0.tsv"), join[0]);
|
||||
File.WriteAllText(Path.Combine(textFileDirectory, "1.tsv"), join[1]);
|
||||
}
|
||||
connectionNameAndTicks = after.Substring(0, after.Length - 2 - comment.Length);
|
||||
connectionName = connectionNameAndTicks.Substring(0, connectionNameAndTicks.Length - ticks.Length);
|
||||
ticks = connectionNameAndTicks.Substring(connectionName.Length);
|
||||
}
|
||||
result = Path.Combine(environment, equipmentTypeDirectory, versionName, $"{environment}__{rawVersionName}__{equipmentTypeDirectory}__{connectionName}", ticks, $"{connectionName.Replace('_', '-')}.json");
|
||||
if (result.Contains('/'))
|
||||
result = string.Concat('/', result);
|
||||
else
|
||||
result = string.Concat('\\', result);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static void CompareSaveJSON(string textFileDirectory, string[] json)
|
||||
internal static void CompareSaveTSV(string textFileDirectory, string[] join)
|
||||
{
|
||||
if (join[0] != join[1])
|
||||
{
|
||||
if (json[0] != json[1])
|
||||
{
|
||||
Process.Start("explorer.exe", textFileDirectory);
|
||||
File.WriteAllText(Path.Combine(textFileDirectory, "0.json"), json[0]);
|
||||
File.WriteAllText(Path.Combine(textFileDirectory, "1.json"), json[1]);
|
||||
}
|
||||
_ = Process.Start("explorer.exe", textFileDirectory);
|
||||
File.WriteAllText(Path.Combine(textFileDirectory, "0.tsv"), join[0]);
|
||||
File.WriteAllText(Path.Combine(textFileDirectory, "1.tsv"), join[1]);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void CompareSave(string textFileDirectory, Tuple<string, string[], string[]> pdsf, Tuple<string, string[], string[]> pdsfNew)
|
||||
internal static void CompareSaveJSON(string textFileDirectory, string[] json)
|
||||
{
|
||||
if (json[0] != json[1])
|
||||
{
|
||||
if (pdsf.Item1 != pdsfNew.Item1)
|
||||
{
|
||||
Process.Start("explorer.exe", textFileDirectory);
|
||||
File.WriteAllText(Path.Combine(textFileDirectory, "0.dat"), pdsf.Item1);
|
||||
File.WriteAllText(Path.Combine(textFileDirectory, "1.dat"), pdsfNew.Item1);
|
||||
}
|
||||
_ = Process.Start("explorer.exe", textFileDirectory);
|
||||
File.WriteAllText(Path.Combine(textFileDirectory, "0.json"), json[0]);
|
||||
File.WriteAllText(Path.Combine(textFileDirectory, "1.json"), json[1]);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void CompareSave(string textFileDirectory, Tuple<string, string[], string[]> pdsf, Tuple<string, string[], string[]> pdsfNew)
|
||||
{
|
||||
if (pdsf.Item1 != pdsfNew.Item1)
|
||||
{
|
||||
_ = Process.Start("explorer.exe", textFileDirectory);
|
||||
File.WriteAllText(Path.Combine(textFileDirectory, "0.dat"), pdsf.Item1);
|
||||
File.WriteAllText(Path.Combine(textFileDirectory, "1.dat"), pdsfNew.Item1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,30 +1,24 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
|
||||
namespace Shared
|
||||
namespace Shared;
|
||||
|
||||
public class EAFLoggingUnitTesting : LoggingUnitTesting, IDisposable
|
||||
{
|
||||
|
||||
public class EAFLoggingUnitTesting : LoggingUnitTesting, IDisposable
|
||||
protected readonly AdaptationTesting _AdaptationTesting;
|
||||
|
||||
public AdaptationTesting AdaptationTesting => _AdaptationTesting;
|
||||
|
||||
public EAFLoggingUnitTesting(TestContext testContext, Type declaringType, bool skipEquipmentDictionary) :
|
||||
base(testContext, declaringType)
|
||||
{
|
||||
|
||||
protected readonly AdaptationTesting _AdaptationTesting;
|
||||
|
||||
public AdaptationTesting AdaptationTesting => _AdaptationTesting;
|
||||
|
||||
public EAFLoggingUnitTesting(TestContext testContext, Type declaringType, bool skipEquipmentDictionary) :
|
||||
base(testContext, declaringType)
|
||||
{
|
||||
if (testContext is null || declaringType is null)
|
||||
_AdaptationTesting = null;
|
||||
else
|
||||
_AdaptationTesting = new AdaptationTesting(testContext, skipEquipmentDictionary);
|
||||
}
|
||||
|
||||
public new void Dispose()
|
||||
{
|
||||
base.Dispose();
|
||||
}
|
||||
|
||||
if (testContext is null || declaringType is null)
|
||||
_AdaptationTesting = null;
|
||||
else
|
||||
_AdaptationTesting = new AdaptationTesting(testContext, skipEquipmentDictionary);
|
||||
}
|
||||
|
||||
public new void Dispose() => base.Dispose();
|
||||
|
||||
}
|
@ -2,170 +2,167 @@ using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Shared
|
||||
namespace Shared;
|
||||
|
||||
public class IsEnvironment
|
||||
{
|
||||
|
||||
public class IsEnvironment
|
||||
public enum Name
|
||||
{
|
||||
LinuxDevelopment,
|
||||
LinuxProduction,
|
||||
LinuxStaging,
|
||||
OSXDevelopment,
|
||||
OSXProduction,
|
||||
OSXStaging,
|
||||
WindowsDevelopment,
|
||||
WindowsProduction,
|
||||
WindowsStaging
|
||||
}
|
||||
|
||||
public enum Name
|
||||
public bool DebuggerWasAttachedDuringConstructor { get; private set; }
|
||||
public bool Development { get; private set; }
|
||||
public bool Linux { get; private set; }
|
||||
public bool OSX { get; private set; }
|
||||
public bool Production { get; private set; }
|
||||
public bool Staging { get; private set; }
|
||||
public bool Windows { get; private set; }
|
||||
public string Profile { get; private set; }
|
||||
public string AppSettingsFileName { get; private set; }
|
||||
public string ASPNetCoreEnvironment { get; private set; }
|
||||
|
||||
public IsEnvironment(string testCategory)
|
||||
{
|
||||
if (testCategory.EndsWith(".json"))
|
||||
{
|
||||
LinuxDevelopment,
|
||||
LinuxProduction,
|
||||
LinuxStaging,
|
||||
OSXDevelopment,
|
||||
OSXProduction,
|
||||
OSXStaging,
|
||||
WindowsDevelopment,
|
||||
WindowsProduction,
|
||||
WindowsStaging
|
||||
}
|
||||
|
||||
public bool DebuggerWasAttachedDuringConstructor { get; private set; }
|
||||
public bool Development { get; private set; }
|
||||
public bool Linux { get; private set; }
|
||||
public bool OSX { get; private set; }
|
||||
public bool Production { get; private set; }
|
||||
public bool Staging { get; private set; }
|
||||
public bool Windows { get; private set; }
|
||||
public string Profile { get; private set; }
|
||||
public string AppSettingsFileName { get; private set; }
|
||||
public string ASPNetCoreEnvironment { get; private set; }
|
||||
|
||||
public IsEnvironment(string testCategory)
|
||||
{
|
||||
if (testCategory.EndsWith(".json"))
|
||||
{
|
||||
Production = testCategory == "appsettings.json";
|
||||
Staging = testCategory.EndsWith(nameof(Staging));
|
||||
OSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
|
||||
Development = testCategory.EndsWith(nameof(Development));
|
||||
Linux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
|
||||
DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
|
||||
Windows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
|
||||
ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
|
||||
}
|
||||
else
|
||||
{
|
||||
DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
|
||||
OSX = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(OSX));
|
||||
ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
|
||||
Linux = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(Linux));
|
||||
Staging = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Staging));
|
||||
Windows = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(Windows));
|
||||
Production = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Production));
|
||||
Development = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Development));
|
||||
}
|
||||
Profile = GetProfile();
|
||||
AppSettingsFileName = GetAppSettingsFileName(processesCount: null);
|
||||
}
|
||||
|
||||
public IsEnvironment(bool isDevelopment, bool isStaging, bool isProduction)
|
||||
{
|
||||
Staging = isStaging;
|
||||
Production = isProduction;
|
||||
Development = isDevelopment;
|
||||
Production = testCategory == "appsettings.json";
|
||||
Staging = testCategory.EndsWith(nameof(Staging));
|
||||
OSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
|
||||
Development = testCategory.EndsWith(nameof(Development));
|
||||
Linux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
|
||||
DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
|
||||
Windows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
|
||||
ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
|
||||
Profile = GetProfile();
|
||||
AppSettingsFileName = GetAppSettingsFileName(processesCount: null);
|
||||
}
|
||||
|
||||
public IsEnvironment(int? processesCount, bool nullASPNetCoreEnvironmentIsDevelopment, bool nullASPNetCoreEnvironmentIsProduction)
|
||||
else
|
||||
{
|
||||
OSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
|
||||
Linux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
|
||||
DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
|
||||
Windows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
|
||||
OSX = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(OSX));
|
||||
ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
|
||||
if (nullASPNetCoreEnvironmentIsDevelopment && nullASPNetCoreEnvironmentIsProduction)
|
||||
throw new Exception();
|
||||
else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && nullASPNetCoreEnvironmentIsProduction)
|
||||
Production = true;
|
||||
else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && nullASPNetCoreEnvironmentIsDevelopment)
|
||||
Development = true;
|
||||
else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && !nullASPNetCoreEnvironmentIsDevelopment && !nullASPNetCoreEnvironmentIsProduction)
|
||||
throw new Exception();
|
||||
else
|
||||
{
|
||||
Staging = ASPNetCoreEnvironment is not null && ASPNetCoreEnvironment.EndsWith(nameof(Staging));
|
||||
Production = ASPNetCoreEnvironment is not null && ASPNetCoreEnvironment.EndsWith(nameof(Production));
|
||||
Development = ASPNetCoreEnvironment is not null && ASPNetCoreEnvironment.EndsWith(nameof(Development));
|
||||
}
|
||||
Profile = GetProfile();
|
||||
AppSettingsFileName = GetAppSettingsFileName(processesCount);
|
||||
Linux = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(Linux));
|
||||
Staging = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Staging));
|
||||
Windows = !string.IsNullOrEmpty(testCategory) && testCategory.StartsWith(nameof(Windows));
|
||||
Production = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Production));
|
||||
Development = !string.IsNullOrEmpty(testCategory) && testCategory.EndsWith(nameof(Development));
|
||||
}
|
||||
Profile = GetProfile();
|
||||
AppSettingsFileName = GetAppSettingsFileName(processesCount: null);
|
||||
}
|
||||
|
||||
private string GetProfile()
|
||||
public IsEnvironment(bool isDevelopment, bool isStaging, bool isProduction)
|
||||
{
|
||||
Staging = isStaging;
|
||||
Production = isProduction;
|
||||
Development = isDevelopment;
|
||||
OSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
|
||||
Linux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
|
||||
DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
|
||||
Windows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
|
||||
ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
|
||||
Profile = GetProfile();
|
||||
AppSettingsFileName = GetAppSettingsFileName(processesCount: null);
|
||||
}
|
||||
|
||||
public IsEnvironment(int? processesCount, bool nullASPNetCoreEnvironmentIsDevelopment, bool nullASPNetCoreEnvironmentIsProduction)
|
||||
{
|
||||
OSX = RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
|
||||
Linux = RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
|
||||
DebuggerWasAttachedDuringConstructor = Debugger.IsAttached;
|
||||
Windows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
|
||||
ASPNetCoreEnvironment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT");
|
||||
if (nullASPNetCoreEnvironmentIsDevelopment && nullASPNetCoreEnvironmentIsProduction)
|
||||
throw new Exception();
|
||||
else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && nullASPNetCoreEnvironmentIsProduction)
|
||||
Production = true;
|
||||
else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && nullASPNetCoreEnvironmentIsDevelopment)
|
||||
Development = true;
|
||||
else if (string.IsNullOrEmpty(ASPNetCoreEnvironment) && !nullASPNetCoreEnvironmentIsDevelopment && !nullASPNetCoreEnvironmentIsProduction)
|
||||
throw new Exception();
|
||||
else
|
||||
{
|
||||
string result;
|
||||
if (Windows && Production)
|
||||
result = nameof(Production);
|
||||
else if (Windows && Staging)
|
||||
result = nameof(Staging);
|
||||
else if (Windows && Development)
|
||||
result = nameof(Development);
|
||||
else if (Linux && Production)
|
||||
result = nameof(Name.LinuxProduction);
|
||||
else if (Linux && Staging)
|
||||
result = nameof(Name.LinuxStaging);
|
||||
else if (Linux && Development)
|
||||
result = nameof(Name.LinuxDevelopment);
|
||||
else if (OSX && Production)
|
||||
result = nameof(Name.OSXProduction);
|
||||
else if (OSX && Staging)
|
||||
result = nameof(Name.OSXStaging);
|
||||
else if (OSX && Development)
|
||||
result = nameof(Name.OSXDevelopment);
|
||||
Staging = ASPNetCoreEnvironment is not null && ASPNetCoreEnvironment.EndsWith(nameof(Staging));
|
||||
Production = ASPNetCoreEnvironment is not null && ASPNetCoreEnvironment.EndsWith(nameof(Production));
|
||||
Development = ASPNetCoreEnvironment is not null && ASPNetCoreEnvironment.EndsWith(nameof(Development));
|
||||
}
|
||||
Profile = GetProfile();
|
||||
AppSettingsFileName = GetAppSettingsFileName(processesCount);
|
||||
}
|
||||
|
||||
private string GetProfile()
|
||||
{
|
||||
string result;
|
||||
if (Windows && Production)
|
||||
result = nameof(Production);
|
||||
else if (Windows && Staging)
|
||||
result = nameof(Staging);
|
||||
else if (Windows && Development)
|
||||
result = nameof(Development);
|
||||
else if (Linux && Production)
|
||||
result = nameof(Name.LinuxProduction);
|
||||
else if (Linux && Staging)
|
||||
result = nameof(Name.LinuxStaging);
|
||||
else if (Linux && Development)
|
||||
result = nameof(Name.LinuxDevelopment);
|
||||
else if (OSX && Production)
|
||||
result = nameof(Name.OSXProduction);
|
||||
else if (OSX && Staging)
|
||||
result = nameof(Name.OSXStaging);
|
||||
else if (OSX && Development)
|
||||
result = nameof(Name.OSXDevelopment);
|
||||
else
|
||||
throw new Exception();
|
||||
return result;
|
||||
}
|
||||
|
||||
private string GetAppSettingsFileName(int? processesCount)
|
||||
{
|
||||
string result;
|
||||
if (Production)
|
||||
{
|
||||
if (processesCount is null)
|
||||
result = "appsettings.json";
|
||||
else
|
||||
result = $"appsettings.{processesCount}.json";
|
||||
}
|
||||
else
|
||||
{
|
||||
string environment;
|
||||
if (Staging)
|
||||
environment = nameof(Staging);
|
||||
else if (Development)
|
||||
environment = nameof(Development);
|
||||
else
|
||||
throw new Exception();
|
||||
return result;
|
||||
}
|
||||
|
||||
private string GetAppSettingsFileName(int? processesCount)
|
||||
{
|
||||
string result;
|
||||
if (Production)
|
||||
{
|
||||
if (processesCount is null)
|
||||
result = "appsettings.json";
|
||||
else
|
||||
result = $"appsettings.{processesCount}.json";
|
||||
}
|
||||
if (processesCount is null)
|
||||
result = $"appsettings.{environment}.json";
|
||||
else
|
||||
{
|
||||
string environment;
|
||||
if (Staging)
|
||||
environment = nameof(Staging);
|
||||
else if (Development)
|
||||
environment = nameof(Development);
|
||||
else
|
||||
throw new Exception();
|
||||
if (processesCount is null)
|
||||
result = $"appsettings.{environment}.json";
|
||||
else
|
||||
result = $"appsettings.{environment}.{processesCount}.json";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static string GetEnvironmentName(IsEnvironment isEnvironment)
|
||||
{
|
||||
string result;
|
||||
if (isEnvironment.Windows)
|
||||
result = nameof(IsEnvironment.Windows);
|
||||
else if (isEnvironment.Linux)
|
||||
result = nameof(IsEnvironment.Linux);
|
||||
else if (isEnvironment.OSX)
|
||||
result = nameof(IsEnvironment.OSX);
|
||||
else
|
||||
throw new Exception();
|
||||
return result;
|
||||
result = $"appsettings.{environment}.{processesCount}.json";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static string GetEnvironmentName(IsEnvironment isEnvironment)
|
||||
{
|
||||
string result;
|
||||
if (isEnvironment.Windows)
|
||||
result = nameof(IsEnvironment.Windows);
|
||||
else if (isEnvironment.Linux)
|
||||
result = nameof(IsEnvironment.Linux);
|
||||
else if (isEnvironment.OSX)
|
||||
result = nameof(IsEnvironment.OSX);
|
||||
else
|
||||
throw new Exception();
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -5,109 +5,103 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Shared
|
||||
namespace Shared;
|
||||
|
||||
public class LoggingUnitTesting : UnitTesting, IDisposable
|
||||
{
|
||||
|
||||
public class LoggingUnitTesting : UnitTesting, IDisposable
|
||||
protected ILogger<object> _Logger;
|
||||
protected ILoggerFactory _LoggerFactory;
|
||||
protected readonly LogLevel? _DefaultLogLevel;
|
||||
protected readonly LogLevel? _Log4netProviderLogLevel;
|
||||
protected readonly IConfigurationRoot _ConfigurationRoot;
|
||||
public ILogger<object> Logger => _Logger;
|
||||
public LogLevel? DefaultLogLevel => _DefaultLogLevel;
|
||||
public ILoggerFactory LoggerFactory => _LoggerFactory;
|
||||
public IConfigurationRoot ConfigurationRoot => _ConfigurationRoot;
|
||||
public LogLevel? Log4netProviderLogLevel => _Log4netProviderLogLevel;
|
||||
|
||||
public LoggingUnitTesting(TestContext testContext, Type declaringType) :
|
||||
base(testContext, declaringType)
|
||||
{
|
||||
|
||||
protected ILogger<object> _Logger;
|
||||
protected ILoggerFactory _LoggerFactory;
|
||||
protected readonly LogLevel? _DefaultLogLevel;
|
||||
protected readonly LogLevel? _Log4netProviderLogLevel;
|
||||
protected readonly IConfigurationRoot _ConfigurationRoot;
|
||||
public ILogger<object> Logger => _Logger;
|
||||
public LogLevel? DefaultLogLevel => _DefaultLogLevel;
|
||||
public ILoggerFactory LoggerFactory => _LoggerFactory;
|
||||
public IConfigurationRoot ConfigurationRoot => _ConfigurationRoot;
|
||||
public LogLevel? Log4netProviderLogLevel => _Log4netProviderLogLevel;
|
||||
|
||||
public LoggingUnitTesting(TestContext testContext, Type declaringType) :
|
||||
base(testContext, declaringType)
|
||||
_LoggerFactory = new LoggerFactory();
|
||||
if (testContext is null || declaringType is null)
|
||||
{
|
||||
_LoggerFactory = new LoggerFactory();
|
||||
if (testContext is null || declaringType is null)
|
||||
{
|
||||
_ConfigurationRoot = null;
|
||||
_DefaultLogLevel = null;
|
||||
_Log4netProviderLogLevel = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
LogLevel logLevel;
|
||||
IConfigurationSection configurationSection;
|
||||
List<LogLevel> logLevels = new List<LogLevel>();
|
||||
string defaultLogLevelSection = "Logging:LogLevel:Default";
|
||||
string log4netProviderLogLevelSection = "Logging:LogLevel:Log4netProvider";
|
||||
string[] sections = new string[] { defaultLogLevelSection, log4netProviderLogLevelSection };
|
||||
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
|
||||
.AddEnvironmentVariables()
|
||||
.AddJsonFile(_IsEnvironment.AppSettingsFileName, optional: false, reloadOnChange: true);
|
||||
_ConfigurationRoot = configurationBuilder.Build();
|
||||
foreach (string section in sections)
|
||||
{
|
||||
configurationSection = _ConfigurationRoot.GetSection(section);
|
||||
if (configurationSection is null)
|
||||
logLevel = LogLevel.Debug;
|
||||
else if (!Enum.TryParse<LogLevel>(configurationSection.Value, out logLevel))
|
||||
logLevel = LogLevel.Debug;
|
||||
logLevels.Add(logLevel);
|
||||
}
|
||||
_DefaultLogLevel = logLevels[0];
|
||||
_Log4netProviderLogLevel = logLevels[1];
|
||||
}
|
||||
if (DefaultLogLevel.HasValue)
|
||||
_LoggerFactory.AddProvider(new DebugProvider(DefaultLogLevel.Value));
|
||||
if (DefaultLogLevel.HasValue)
|
||||
_LoggerFactory.AddProvider(new ConsoleProvider(DefaultLogLevel.Value));
|
||||
_Logger = _LoggerFactory.CreateLogger<object>();
|
||||
_ConfigurationRoot = null;
|
||||
_DefaultLogLevel = null;
|
||||
_Log4netProviderLogLevel = null;
|
||||
}
|
||||
|
||||
public static string GetEnvironmentSpecialDirectory()
|
||||
else
|
||||
{
|
||||
string result = string.Empty;
|
||||
string traceFile;
|
||||
List<string> directories = new List<string>();
|
||||
Environment.SpecialFolder[] specialFolders = new Environment.SpecialFolder[]
|
||||
LogLevel logLevel;
|
||||
IConfigurationSection configurationSection;
|
||||
List<LogLevel> logLevels = new();
|
||||
string defaultLogLevelSection = "Logging:LogLevel:Default";
|
||||
string log4netProviderLogLevelSection = "Logging:LogLevel:Log4netProvider";
|
||||
string[] sections = new string[] { defaultLogLevelSection, log4netProviderLogLevelSection };
|
||||
IConfigurationBuilder configurationBuilder = new ConfigurationBuilder()
|
||||
.AddEnvironmentVariables()
|
||||
.AddJsonFile(_IsEnvironment.AppSettingsFileName, optional: false, reloadOnChange: true);
|
||||
_ConfigurationRoot = configurationBuilder.Build();
|
||||
foreach (string section in sections)
|
||||
{
|
||||
configurationSection = _ConfigurationRoot.GetSection(section);
|
||||
if (configurationSection is null)
|
||||
logLevel = LogLevel.Debug;
|
||||
else if (!Enum.TryParse<LogLevel>(configurationSection.Value, out logLevel))
|
||||
logLevel = LogLevel.Debug;
|
||||
logLevels.Add(logLevel);
|
||||
}
|
||||
_DefaultLogLevel = logLevels[0];
|
||||
_Log4netProviderLogLevel = logLevels[1];
|
||||
}
|
||||
if (DefaultLogLevel.HasValue)
|
||||
_LoggerFactory.AddProvider(new DebugProvider(DefaultLogLevel.Value));
|
||||
if (DefaultLogLevel.HasValue)
|
||||
_LoggerFactory.AddProvider(new ConsoleProvider(DefaultLogLevel.Value));
|
||||
_Logger = _LoggerFactory.CreateLogger<object>();
|
||||
}
|
||||
|
||||
public static string GetEnvironmentSpecialDirectory()
|
||||
{
|
||||
string result = string.Empty;
|
||||
string traceFile;
|
||||
List<string> directories = new();
|
||||
Environment.SpecialFolder[] specialFolders = new Environment.SpecialFolder[]
|
||||
{
|
||||
Environment.SpecialFolder.LocalApplicationData,
|
||||
Environment.SpecialFolder.ApplicationData,
|
||||
Environment.SpecialFolder.History,
|
||||
Environment.SpecialFolder.CommonApplicationData,
|
||||
Environment.SpecialFolder.InternetCache
|
||||
};
|
||||
foreach (Environment.SpecialFolder specialFolder in specialFolders)
|
||||
directories.Add(Environment.GetFolderPath(specialFolder));
|
||||
foreach (string directory in directories)
|
||||
{
|
||||
for (int i = 1; i < 3; i++)
|
||||
{
|
||||
if (i == 1)
|
||||
result = directory;
|
||||
else
|
||||
result = string.Concat("D", directory.Substring(1));
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(result))
|
||||
Directory.CreateDirectory(result);
|
||||
traceFile = string.Concat(result, @"\", DateTime.Now.Ticks, ".txt");
|
||||
File.WriteAllText(traceFile, traceFile);
|
||||
File.Delete(traceFile);
|
||||
break;
|
||||
}
|
||||
catch (Exception) { result = string.Empty; }
|
||||
}
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
};
|
||||
foreach (Environment.SpecialFolder specialFolder in specialFolders)
|
||||
directories.Add(Environment.GetFolderPath(specialFolder));
|
||||
foreach (string directory in directories)
|
||||
{
|
||||
_LoggerFactory.Dispose();
|
||||
for (int i = 1; i < 3; i++)
|
||||
{
|
||||
if (i == 1)
|
||||
result = directory;
|
||||
else
|
||||
result = string.Concat("D", directory.Substring(1));
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(result))
|
||||
_ = Directory.CreateDirectory(result);
|
||||
traceFile = string.Concat(result, @"\", DateTime.Now.Ticks, ".txt");
|
||||
File.WriteAllText(traceFile, traceFile);
|
||||
File.Delete(traceFile);
|
||||
break;
|
||||
}
|
||||
catch (Exception) { result = string.Empty; }
|
||||
}
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public void Dispose() => _LoggerFactory.Dispose();
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,25 +1,23 @@
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace Shared.PasteSpecialXml.EAF.XML.API.ConfigurationData
|
||||
namespace Shared.PasteSpecialXml.EAF.XML.API.ConfigurationData;
|
||||
|
||||
[XmlRoot(ElementName = "ChildBackboneMembers", Namespace = "http://schemas.datacontract.org/2004/07/EafManagement.Configuration.Services")]
|
||||
public class ChildBackboneMembers
|
||||
{
|
||||
[XmlRoot(ElementName = "ChildBackboneMembers", Namespace = "http://schemas.datacontract.org/2004/07/EafManagement.Configuration.Services")]
|
||||
public class ChildBackboneMembers
|
||||
{
|
||||
[XmlAttribute(AttributeName = "nil", Namespace = "http://www.w3.org/2001/XMLSchema-instance")]
|
||||
public string Nil { get; set; }
|
||||
}
|
||||
|
||||
[XmlRoot(ElementName = "ConfigurationData", Namespace = "http://schemas.datacontract.org/2004/07/EafManagement.Configuration.Services")]
|
||||
public class ConfigurationData
|
||||
{
|
||||
[XmlElement(ElementName = "ChildBackboneMembers", Namespace = "http://schemas.datacontract.org/2004/07/EafManagement.Configuration.Services")]
|
||||
public ChildBackboneMembers ChildBackboneMembers { get; set; }
|
||||
[XmlElement(ElementName = "Data", Namespace = "http://schemas.datacontract.org/2004/07/EafManagement.Configuration.Services")]
|
||||
public string Data { get; set; }
|
||||
[XmlAttribute(AttributeName = "xmlns")]
|
||||
public string Xmlns { get; set; }
|
||||
[XmlAttribute(AttributeName = "i", Namespace = "http://www.w3.org/2000/xmlns/")]
|
||||
public string I { get; set; }
|
||||
}
|
||||
[XmlAttribute(AttributeName = "nil", Namespace = "http://www.w3.org/2001/XMLSchema-instance")]
|
||||
public string Nil { get; set; }
|
||||
}
|
||||
|
||||
[XmlRoot(ElementName = "ConfigurationData", Namespace = "http://schemas.datacontract.org/2004/07/EafManagement.Configuration.Services")]
|
||||
public class ConfigurationData
|
||||
{
|
||||
[XmlElement(ElementName = "ChildBackboneMembers", Namespace = "http://schemas.datacontract.org/2004/07/EafManagement.Configuration.Services")]
|
||||
public ChildBackboneMembers ChildBackboneMembers { get; set; }
|
||||
[XmlElement(ElementName = "Data", Namespace = "http://schemas.datacontract.org/2004/07/EafManagement.Configuration.Services")]
|
||||
public string Data { get; set; }
|
||||
[XmlAttribute(AttributeName = "xmlns")]
|
||||
public string Xmlns { get; set; }
|
||||
[XmlAttribute(AttributeName = "i", Namespace = "http://www.w3.org/2000/xmlns/")]
|
||||
public string I { get; set; }
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -8,86 +8,83 @@ using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
|
||||
namespace Shared
|
||||
namespace Shared;
|
||||
|
||||
public class UnitTesting
|
||||
{
|
||||
|
||||
public class UnitTesting
|
||||
protected readonly IsEnvironment _IsEnvironment;
|
||||
|
||||
public IsEnvironment IsEnvironment => _IsEnvironment;
|
||||
|
||||
public UnitTesting(TestContext testContext, Type declaringType)
|
||||
{
|
||||
|
||||
protected readonly IsEnvironment _IsEnvironment;
|
||||
|
||||
public IsEnvironment IsEnvironment => _IsEnvironment;
|
||||
|
||||
public UnitTesting(TestContext testContext, Type declaringType)
|
||||
if (testContext is null || declaringType is null)
|
||||
_IsEnvironment = null;
|
||||
else
|
||||
{
|
||||
if (testContext is null || declaringType is null)
|
||||
_IsEnvironment = null;
|
||||
else
|
||||
{
|
||||
string projectDirectory = GetProjectDirectory(testContext);
|
||||
string json = JsonSerializer.Serialize(testContext.Properties);
|
||||
string vsCodeDirectory = Path.Combine(projectDirectory, ".vscode");
|
||||
if (!Directory.Exists(vsCodeDirectory))
|
||||
Directory.CreateDirectory(vsCodeDirectory);
|
||||
string launchText = GetLaunchText();
|
||||
File.WriteAllText(Path.Combine(vsCodeDirectory, "launch.json"), launchText);
|
||||
for (int i = 0; i < int.MaxValue; i++)
|
||||
{
|
||||
if (!json.Contains("Debugger.IsAttached") || Debugger.IsAttached)
|
||||
break;
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
MethodBase methodBase = declaringType.GetMethod(testContext.TestName);
|
||||
if (!(methodBase is null))
|
||||
{
|
||||
TestCategoryAttribute testCategoryAttribute = methodBase.GetCustomAttribute<TestCategoryAttribute>();
|
||||
if (!(testCategoryAttribute is null))
|
||||
{
|
||||
foreach (string testCategory in testCategoryAttribute.TestCategories)
|
||||
_IsEnvironment = new IsEnvironment(testCategory);
|
||||
}
|
||||
}
|
||||
if (_IsEnvironment is null)
|
||||
_IsEnvironment = new IsEnvironment(processesCount: null, nullASPNetCoreEnvironmentIsDevelopment: Debugger.IsAttached, nullASPNetCoreEnvironmentIsProduction: !Debugger.IsAttached);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string GetProjectDirectory(TestContext testContext)
|
||||
{
|
||||
string result;
|
||||
string[] checkFiles = null;
|
||||
result = Path.GetDirectoryName(testContext.DeploymentDirectory);
|
||||
string projectDirectory = GetProjectDirectory(testContext);
|
||||
string json = JsonSerializer.Serialize(testContext.Properties);
|
||||
string vsCodeDirectory = Path.Combine(projectDirectory, ".vscode");
|
||||
if (!Directory.Exists(vsCodeDirectory))
|
||||
_ = Directory.CreateDirectory(vsCodeDirectory);
|
||||
string launchText = GetLaunchText();
|
||||
File.WriteAllText(Path.Combine(vsCodeDirectory, "launch.json"), launchText);
|
||||
for (int i = 0; i < int.MaxValue; i++)
|
||||
{
|
||||
if (string.IsNullOrEmpty(result))
|
||||
if (!json.Contains("Debugger.IsAttached") || Debugger.IsAttached)
|
||||
break;
|
||||
checkFiles = Directory.GetFiles(result, "*.Tests.*proj", SearchOption.TopDirectoryOnly);
|
||||
if (checkFiles.Any())
|
||||
break;
|
||||
result = Path.GetDirectoryName(result);
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
if (string.IsNullOrEmpty(result) || checkFiles is null || !checkFiles.Any())
|
||||
throw new Exception(result);
|
||||
return result;
|
||||
MethodBase methodBase = declaringType.GetMethod(testContext.TestName);
|
||||
if (methodBase is not null)
|
||||
{
|
||||
TestCategoryAttribute testCategoryAttribute = methodBase.GetCustomAttribute<TestCategoryAttribute>();
|
||||
if (testCategoryAttribute is not null)
|
||||
{
|
||||
foreach (string testCategory in testCategoryAttribute.TestCategories)
|
||||
_IsEnvironment = new IsEnvironment(testCategory);
|
||||
}
|
||||
}
|
||||
if (_IsEnvironment is null)
|
||||
_IsEnvironment = new IsEnvironment(processesCount: null, nullASPNetCoreEnvironmentIsDevelopment: Debugger.IsAttached, nullASPNetCoreEnvironmentIsProduction: !Debugger.IsAttached);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string GetLaunchText()
|
||||
internal static string GetProjectDirectory(TestContext testContext)
|
||||
{
|
||||
string result;
|
||||
string[] checkFiles = null;
|
||||
result = Path.GetDirectoryName(testContext.DeploymentDirectory);
|
||||
for (int i = 0; i < int.MaxValue; i++)
|
||||
{
|
||||
StringBuilder result = new StringBuilder();
|
||||
result.
|
||||
AppendLine("{").
|
||||
AppendLine(" \"configurations\": [").
|
||||
AppendLine(" {").
|
||||
AppendLine(" \"name\": \".NET Core Attach\",").
|
||||
AppendLine(" \"type\": \"coreclr\",").
|
||||
AppendLine(" \"request\": \"attach\",").
|
||||
AppendLine($" \"processId\": {System.Diagnostics.Process.GetCurrentProcess().Id}").
|
||||
AppendLine(" }").
|
||||
AppendLine(" ]").
|
||||
AppendLine("}");
|
||||
return result.ToString();
|
||||
if (string.IsNullOrEmpty(result))
|
||||
break;
|
||||
checkFiles = Directory.GetFiles(result, "*.Tests.*proj", SearchOption.TopDirectoryOnly);
|
||||
if (checkFiles.Any())
|
||||
break;
|
||||
result = Path.GetDirectoryName(result);
|
||||
}
|
||||
if (string.IsNullOrEmpty(result) || checkFiles is null || !checkFiles.Any())
|
||||
throw new Exception(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static string GetLaunchText()
|
||||
{
|
||||
StringBuilder result = new();
|
||||
_ = result.
|
||||
AppendLine("{").
|
||||
AppendLine(" \"configurations\": [").
|
||||
AppendLine(" {").
|
||||
AppendLine(" \"name\": \".NET Core Attach\",").
|
||||
AppendLine(" \"type\": \"coreclr\",").
|
||||
AppendLine(" \"request\": \"attach\",").
|
||||
AppendLine($" \"processId\": {Process.GetCurrentProcess().Id}").
|
||||
AppendLine(" }").
|
||||
AppendLine(" ]").
|
||||
AppendLine("}");
|
||||
return result.ToString();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user