Ready to start testing
This commit is contained in:
@ -0,0 +1,171 @@
|
||||
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 DEP08SIASM : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static DEP08SIASM EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
public DEP08SIASM() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public DEP08SIASM(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
EAFLoggingUnitTesting = new DEP08SIASM(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__DEP08SIASM__DEP08SIASM()
|
||||
{
|
||||
string check = "~EDA-IQS";
|
||||
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));
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains("DEP08SIASM"));
|
||||
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__DEP08SIASM__DEP08SIASM_()
|
||||
{
|
||||
string check = "~IQS-OpenInsight";
|
||||
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));
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains("DEP08SIASM-"));
|
||||
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__DEP08SIASM__DEP08SIASM__()
|
||||
{
|
||||
string check = "~OpenInsight-APC";
|
||||
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));
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains("DEP08SIASM--"));
|
||||
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__DEP08SIASM__DEP08SIASM___()
|
||||
{
|
||||
string check = "~APC-SPaCe";
|
||||
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));
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains("DEP08SIASM---"));
|
||||
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__DEP08SIASM__DEP08SIASM____()
|
||||
{
|
||||
string check = "~SPaCe-SPaCe Villach";
|
||||
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));
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains("DEP08SIASM----"));
|
||||
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__DEP08SIASM__DEP08SIASM_____()
|
||||
{
|
||||
string check = "~SPaCe Villach-Archive";
|
||||
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));
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains("DEP08SIASM-----"));
|
||||
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__DEP08SIASM__DEP08SIASM______()
|
||||
{
|
||||
string check = "~Archive";
|
||||
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));
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains("DEP08SIASM------"));
|
||||
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__DEP08SIASM__DEP08SIASM_______()
|
||||
{
|
||||
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));
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains("DEP08SIASM-------"));
|
||||
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 R34_EQPT : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static R34_EQPT EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
public R34_EQPT() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public R34_EQPT(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
EAFLoggingUnitTesting = new R34_EQPT(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__R34_EQPT__DownloadJpegFile()
|
||||
{
|
||||
string check = ".jpeg";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
_ = Helpers.Deposition.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting);
|
||||
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 R34 : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static R34 EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
public R34() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public R34(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
EAFLoggingUnitTesting = new R34(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__R34__jpeg()
|
||||
{
|
||||
string check = "*.jpeg";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
_ = Helpers.Deposition.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting);
|
||||
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 R36_EQPT : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static R36_EQPT EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
public R36_EQPT() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public R36_EQPT(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
EAFLoggingUnitTesting = new R36_EQPT(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__R36_EQPT__DownloadJpegFile()
|
||||
{
|
||||
string check = ".jpeg";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
_ = Helpers.Deposition.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting);
|
||||
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 R36 : EAFLoggingUnitTesting
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
internal static R36 EAFLoggingUnitTesting { get; private set; }
|
||||
|
||||
public R36() : base(testContext: null, declaringType: null, skipEquipmentDictionary: false)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
throw new Exception();
|
||||
}
|
||||
|
||||
public R36(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType, skipEquipmentDictionary: false)
|
||||
{
|
||||
}
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
if (EAFLoggingUnitTesting is null)
|
||||
EAFLoggingUnitTesting = new R36(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__R36__jpeg()
|
||||
{
|
||||
string check = "*.jpeg";
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
|
||||
_ = Helpers.Deposition.GetWriteConfigurationGetFileRead(methodBase, check, EAFLoggingUnitTesting.AdaptationTesting);
|
||||
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
|
||||
}
|
||||
|
||||
}
|
89
Adaptation/_Tests/Extract/Staging/v2.39.0/DEP08SIASM.cs
Normal file
89
Adaptation/_Tests/Extract/Staging/v2.39.0/DEP08SIASM.cs
Normal file
@ -0,0 +1,89 @@
|
||||
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 DEP08SIASM
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
private static CreateSelfDescription.Staging.v2_39_0.DEP08SIASM _DEP08SIASM;
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
CreateSelfDescription.Staging.v2_39_0.DEP08SIASM.ClassInitialize(testContext);
|
||||
_DEP08SIASM = CreateSelfDescription.Staging.v2_39_0.DEP08SIASM.EAFLoggingUnitTesting;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__DEP08SIASM__DEP08SIASM() => _DEP08SIASM.Staging__v2_39_0__DEP08SIASM__DEP08SIASM();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__DEP08SIASM__DEP08SIASM637535051877475932__Health()
|
||||
{
|
||||
string check = "~EDA-IQS";
|
||||
_DEP08SIASM.Staging__v2_39_0__DEP08SIASM__DEP08SIASM();
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
string[] variables = _DEP08SIASM.AdaptationTesting.GetVariables(methodBase, check);
|
||||
IFileRead fileRead = _DEP08SIASM.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
||||
Logistics logistics = new(fileRead);
|
||||
_ = Helpers.Deposition.ReExtractComapareUpdatePassDirectory(variables, fileRead, logistics);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__DEP08SIASM__DEP08SIASM637535051877475932__XML()
|
||||
{
|
||||
string check = "~EDA-IQS";
|
||||
_DEP08SIASM.Staging__v2_39_0__DEP08SIASM__DEP08SIASM();
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
string[] variables = _DEP08SIASM.AdaptationTesting.GetVariables(methodBase, check);
|
||||
IFileRead fileRead = _DEP08SIASM.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
||||
Logistics logistics = new(fileRead);
|
||||
_ = Helpers.Deposition.ReExtractComapareUpdatePassDirectory(variables, fileRead, logistics);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__DEP08SIASM__DEP08SIASM_() => _DEP08SIASM.Staging__v2_39_0__DEP08SIASM__DEP08SIASM_();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__DEP08SIASM__DEP08SIASM_637535051877475932__Health()
|
||||
{
|
||||
string check = "~IQS-OpenInsight";
|
||||
_DEP08SIASM.Staging__v2_39_0__DEP08SIASM__DEP08SIASM_();
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
string[] variables = _DEP08SIASM.AdaptationTesting.GetVariables(methodBase, check);
|
||||
IFileRead fileRead = _DEP08SIASM.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
||||
Logistics logistics = new(fileRead);
|
||||
_ = Helpers.Deposition.ReExtractComapareUpdatePassDirectory(variables, fileRead, logistics);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__DEP08SIASM__DEP08SIASM__() => _DEP08SIASM.Staging__v2_39_0__DEP08SIASM__DEP08SIASM__();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__DEP08SIASM__DEP08SIASM___() => _DEP08SIASM.Staging__v2_39_0__DEP08SIASM__DEP08SIASM___();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__DEP08SIASM__DEP08SIASM____() => _DEP08SIASM.Staging__v2_39_0__DEP08SIASM__DEP08SIASM____();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__DEP08SIASM__DEP08SIASM_____() => _DEP08SIASM.Staging__v2_39_0__DEP08SIASM__DEP08SIASM_____();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__DEP08SIASM__DEP08SIASM______() => _DEP08SIASM.Staging__v2_39_0__DEP08SIASM__DEP08SIASM______();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__DEP08SIASM__DEP08SIASM_______() => _DEP08SIASM.Staging__v2_39_0__DEP08SIASM__DEP08SIASM_______();
|
||||
|
||||
}
|
35
Adaptation/_Tests/Extract/Staging/v2.39.0/R34-EQPT.cs
Normal file
35
Adaptation/_Tests/Extract/Staging/v2.39.0/R34-EQPT.cs
Normal file
@ -0,0 +1,35 @@
|
||||
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 R34_EQPT
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
private static CreateSelfDescription.Staging.v2_39_0.R34_EQPT _R34_EQPT;
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
CreateSelfDescription.Staging.v2_39_0.R34_EQPT.ClassInitialize(testContext);
|
||||
_R34_EQPT = CreateSelfDescription.Staging.v2_39_0.R34_EQPT.EAFLoggingUnitTesting;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__R34_EQPT__DownloadJpegFile() => _R34_EQPT.Staging__v2_39_0__R34_EQPT__DownloadJpegFile();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__R34_EQPT__DownloadJpegFile637812143477007703__Normal() => _R34_EQPT.Staging__v2_39_0__R34_EQPT__DownloadJpegFile();
|
||||
|
||||
}
|
44
Adaptation/_Tests/Extract/Staging/v2.39.0/R34.cs
Normal file
44
Adaptation/_Tests/Extract/Staging/v2.39.0/R34.cs
Normal file
@ -0,0 +1,44 @@
|
||||
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 R34
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
private static CreateSelfDescription.Staging.v2_39_0.R34 _R34;
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
CreateSelfDescription.Staging.v2_39_0.R34.ClassInitialize(testContext);
|
||||
_R34 = CreateSelfDescription.Staging.v2_39_0.R34.EAFLoggingUnitTesting;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__R34__jpeg() => _R34.Staging__v2_39_0__R34__jpeg();
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__R34__jpeg637812143477007703__Normal()
|
||||
{
|
||||
string check = "*.jpeg";
|
||||
_R34.Staging__v2_39_0__R34__jpeg();
|
||||
MethodBase methodBase = new StackFrame().GetMethod();
|
||||
string[] variables = _R34.AdaptationTesting.GetVariables(methodBase, check);
|
||||
IFileRead fileRead = _R34.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
||||
Logistics logistics = new(fileRead);
|
||||
_ = Helpers.Deposition.ReExtractComapareUpdatePassDirectory(variables, fileRead, logistics);
|
||||
}
|
||||
|
||||
}
|
32
Adaptation/_Tests/Extract/Staging/v2.39.0/R36-EQPT.cs
Normal file
32
Adaptation/_Tests/Extract/Staging/v2.39.0/R36-EQPT.cs
Normal file
@ -0,0 +1,32 @@
|
||||
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 R36_EQPT
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
private static CreateSelfDescription.Staging.v2_39_0.R36_EQPT _R36_EQPT;
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
CreateSelfDescription.Staging.v2_39_0.R36_EQPT.ClassInitialize(testContext);
|
||||
_R36_EQPT = CreateSelfDescription.Staging.v2_39_0.R36_EQPT.EAFLoggingUnitTesting;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__R36_EQPT__DownloadJpegFile() => _R36_EQPT.Staging__v2_39_0__R36_EQPT__DownloadJpegFile();
|
||||
|
||||
}
|
32
Adaptation/_Tests/Extract/Staging/v2.39.0/R36.cs
Normal file
32
Adaptation/_Tests/Extract/Staging/v2.39.0/R36.cs
Normal file
@ -0,0 +1,32 @@
|
||||
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 R36
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
private static CreateSelfDescription.Staging.v2_39_0.R36 _R36;
|
||||
|
||||
[ClassInitialize]
|
||||
public static void ClassInitialize(TestContext testContext)
|
||||
{
|
||||
CreateSelfDescription.Staging.v2_39_0.R36.ClassInitialize(testContext);
|
||||
_R36 = CreateSelfDescription.Staging.v2_39_0.R36.EAFLoggingUnitTesting;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Staging__v2_39_0__R36__jpeg() => _R36.Staging__v2_39_0__R36__jpeg();
|
||||
|
||||
}
|
189
Adaptation/_Tests/Helpers/Deposition.cs
Normal file
189
Adaptation/_Tests/Helpers/Deposition.cs
Normal file
@ -0,0 +1,189 @@
|
||||
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.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace _Tests.Helpers;
|
||||
|
||||
public class Deposition
|
||||
{
|
||||
|
||||
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 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 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[] 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 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)
|
||||
{
|
||||
try
|
||||
{ Directory.SetLastWriteTime(directory, dateTime); }
|
||||
catch (System.Exception) { }
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
connectionName = after;
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
internal static void CompareSaveTSV(string textFileDirectory, string[] join)
|
||||
{
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
||||
internal static void CompareSaveJSON(string textFileDirectory, string[] json)
|
||||
{
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
internal static IFileRead GetWriteConfigurationGetFileRead(MethodBase methodBase, string check, Shared.AdaptationTesting adaptationTesting)
|
||||
{
|
||||
IFileRead result;
|
||||
string[] fileNameAndJson = adaptationTesting.GetConfiguration(methodBase);
|
||||
Assert.IsTrue(fileNameAndJson[1].Contains(check));
|
||||
File.WriteAllText(fileNameAndJson[0], fileNameAndJson[1]);
|
||||
result = adaptationTesting.Get(methodBase, sourceFileLocation: string.Empty, sourceFileFilter: string.Empty, useCyclicalForDescription: false);
|
||||
Assert.IsFalse(string.IsNullOrEmpty(result.CellInstanceConnectionName));
|
||||
return result;
|
||||
}
|
||||
|
||||
internal static string ReExtractComapareUpdatePassDirectory(string[] variables, IFileRead fileRead, Logistics logistics)
|
||||
{
|
||||
string result;
|
||||
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);
|
||||
Tuple<string, string[], string[]> pdsf = GetLogisticsColumnsAndBody(variables[2], variables[4]);
|
||||
Tuple<string, string[], string[]> pdsfNew = GetLogisticsColumnsAndBody(fileRead, logistics, extractResult, pdsf);
|
||||
CompareSave(variables[5], pdsf, pdsfNew);
|
||||
Assert.IsTrue(pdsf.Item1 == pdsfNew.Item1, "Item1 check!");
|
||||
string[] json = GetItem2(pdsf, pdsfNew);
|
||||
CompareSaveJSON(variables[5], json);
|
||||
Assert.IsTrue(json[0] == json[1], "Item2 check!");
|
||||
string[] join = GetItem3(pdsf, pdsfNew);
|
||||
CompareSaveTSV(variables[5], join);
|
||||
Assert.IsTrue(join[0] == join[1], "Item3 (Join) check!");
|
||||
UpdatePassDirectory(variables[2]);
|
||||
result = extractResult.Item1;
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
164
Adaptation/_Tests/Helpers/Helper.cs
Normal file
164
Adaptation/_Tests/Helpers/Helper.cs
Normal file
@ -0,0 +1,164 @@
|
||||
// using Adaptation.Shared.Deposition;
|
||||
// using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
// using System;
|
||||
// using System.Collections.Generic;
|
||||
// using System.Diagnostics;
|
||||
// using System.IO;
|
||||
// using System.Linq;
|
||||
// using System.Reflection;
|
||||
// using System.Runtime.InteropServices;
|
||||
// using System.Text;
|
||||
// using System.Text.Json;
|
||||
|
||||
// namespace _Tests.Helpers
|
||||
// {
|
||||
|
||||
// public class Helper
|
||||
// {
|
||||
|
||||
// public static string GetLaunchText()
|
||||
// {
|
||||
// StringBuilder result = new();
|
||||
// _ = 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();
|
||||
// }
|
||||
|
||||
// public static string GetProjectDirectory()
|
||||
// {
|
||||
// string result;
|
||||
// string[] checkFiles = null;
|
||||
// Assembly assembly = Assembly.GetExecutingAssembly();
|
||||
// result = Path.GetDirectoryName(assembly.Location);
|
||||
// for (int i = 0; i < int.MaxValue; i++)
|
||||
// {
|
||||
// if (string.IsNullOrEmpty(result))
|
||||
// break;
|
||||
// checkFiles = Directory.GetFiles(result, "*.Tests.csproj", 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;
|
||||
// }
|
||||
|
||||
// public static string[] GetVariables(string jsonFile, string sourceDirectoryCloaking)
|
||||
// {
|
||||
// string[] results;
|
||||
// string sourceFileFilter = string.Empty;
|
||||
// string sourceFileLocation = string.Empty;
|
||||
// string projectDirectory = GetProjectDirectory();
|
||||
// string equipmentTypeDirectory = Path.GetDirectoryName(Path.GetDirectoryName(Path.GetDirectoryName(projectDirectory)));
|
||||
// string testResultsDirectory = Path.Combine(equipmentTypeDirectory, "05_TestResults");
|
||||
// FileInfo fileInfo = new(string.Concat(testResultsDirectory, jsonFile));
|
||||
// if (!Directory.Exists(fileInfo.Directory.FullName))
|
||||
// _ = Directory.CreateDirectory(fileInfo.Directory.FullName);
|
||||
// if (!fileInfo.Exists)
|
||||
// _ = Process.Start("explorer.exe", fileInfo.Directory.FullName);
|
||||
// string json = File.ReadAllText(fileInfo.FullName);
|
||||
// Assert.IsTrue(json.Contains(sourceDirectoryCloaking));
|
||||
// JsonElement jsonElement = JsonSerializer.Deserialize<JsonElement>(json);
|
||||
// foreach (JsonProperty jsonProperty in jsonElement.EnumerateObject())
|
||||
// {
|
||||
// if (jsonProperty.Name == "SourceFileLocation")
|
||||
// sourceFileLocation = jsonProperty.Value.ToString();
|
||||
// else if (jsonProperty.Name == "SourceFileFilter")
|
||||
// sourceFileFilter = jsonProperty.Value.ToString();
|
||||
// }
|
||||
// results = new string[] { jsonFile, json, sourceFileLocation, sourceFileFilter };
|
||||
|
||||
// Assert.IsFalse(string.IsNullOrEmpty(results[0]));
|
||||
// Assert.IsFalse(string.IsNullOrEmpty(results[1]));
|
||||
// Assert.IsFalse(string.IsNullOrEmpty(results[2]));
|
||||
// Assert.IsFalse(string.IsNullOrEmpty(results[3]));
|
||||
// return results;
|
||||
// }
|
||||
|
||||
// public static Tuple<string, string[], string[]> GetLogisticsColumnsAndBody(string searchDirectory, string searchPattern)
|
||||
// {
|
||||
// Tuple<string, string[], string[]> 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 = ProcessDataStandardFormat.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;
|
||||
// }
|
||||
|
||||
// public static Tuple<string, string[], string[]> GetLogisticsColumnsAndBody(ConfigDataBase configDataBase, ILogic logic, Tuple<string, JsonElement?, List<FileInfo>> extractResult, Tuple<string, string[], string[]> pdsf)
|
||||
// {
|
||||
// Tuple<string, string[], string[]> results;
|
||||
// string text = ProcessDataStandardFormat.GetPDSFText(logic, configDataBase.GetEventName(), configDataBase.GetEquipmentType(), extractResult.Item2.Value, logisticsText: pdsf.Item1);
|
||||
// string[] lines = text.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
|
||||
// results = ProcessDataStandardFormat.GetLogisticsColumnsAndBody(logic.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;
|
||||
// }
|
||||
|
||||
// public 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 };
|
||||
// }
|
||||
|
||||
// public 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 };
|
||||
// }
|
||||
|
||||
// public static void UpdatePassDirectory(string[] variables, MethodBase methodBase)
|
||||
// {
|
||||
// string passDirectory = Path.Combine(variables[2], methodBase.Name);
|
||||
// if (!Directory.Exists(passDirectory))
|
||||
// _ = Directory.CreateDirectory(passDirectory);
|
||||
// else
|
||||
// Directory.SetLastWriteTime(variables[2], DateTime.Now);
|
||||
// }
|
||||
|
||||
// public static string GetFileName(MethodBase methodBase)
|
||||
// {
|
||||
// string result;
|
||||
// string[] segments = methodBase.Name.Split(new string[] { "__" }, 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, "__", rawVersionName, "__", equipmentTypeDirectory, "__");
|
||||
// string after = methodBase.Name.Substring(before.Length);
|
||||
// string connectionNameAndTicks = after.Substring(0, after.Length - 2 - comment.Length);
|
||||
// string 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;
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// }
|
1046
Adaptation/_Tests/Shared/AdaptationTesting.cs
Normal file
1046
Adaptation/_Tests/Shared/AdaptationTesting.cs
Normal file
File diff suppressed because it is too large
Load Diff
28
Adaptation/_Tests/Shared/EAFLoggingUnitTesting.cs
Normal file
28
Adaptation/_Tests/Shared/EAFLoggingUnitTesting.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
|
||||
namespace Shared;
|
||||
|
||||
public class EAFLoggingUnitTesting : LoggingUnitTesting, IDisposable
|
||||
{
|
||||
|
||||
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();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
}
|
168
Adaptation/_Tests/Shared/IsEnvironment.cs
Normal file
168
Adaptation/_Tests/Shared/IsEnvironment.cs
Normal file
@ -0,0 +1,168 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Shared;
|
||||
|
||||
public class IsEnvironment
|
||||
{
|
||||
|
||||
public enum Name
|
||||
{
|
||||
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;
|
||||
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
|
||||
{
|
||||
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();
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
36
Adaptation/_Tests/Shared/Log/ConsoleLogger.cs
Normal file
36
Adaptation/_Tests/Shared/Log/ConsoleLogger.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
|
||||
namespace Shared;
|
||||
|
||||
public class ConsoleLogger : ILogger
|
||||
{
|
||||
|
||||
public int EventId { get; set; }
|
||||
|
||||
private readonly string _Name;
|
||||
private readonly LogLevel _LogLevel;
|
||||
|
||||
public ConsoleLogger(LogLevel logLevel, string name)
|
||||
{
|
||||
_Name = name;
|
||||
EventId = 0;
|
||||
_LogLevel = logLevel;
|
||||
if (string.IsNullOrEmpty(_Name))
|
||||
{ }
|
||||
}
|
||||
|
||||
public IDisposable BeginScope<TState>(TState state) => null;
|
||||
|
||||
public bool IsEnabled(LogLevel logLevel) => logLevel >= _LogLevel;
|
||||
|
||||
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
|
||||
{
|
||||
if (IsEnabled(logLevel) && (EventId == 0 || EventId == eventId.Id))
|
||||
{
|
||||
string message = formatter(state, null);
|
||||
Console.WriteLine(message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
27
Adaptation/_Tests/Shared/Log/ConsoleProvider.cs
Normal file
27
Adaptation/_Tests/Shared/Log/ConsoleProvider.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace Shared;
|
||||
|
||||
public class ConsoleProvider : ILoggerProvider
|
||||
{
|
||||
|
||||
private readonly LogLevel _LogLevel;
|
||||
private readonly ConcurrentDictionary<string, ConsoleLogger> _Loggers;
|
||||
|
||||
public ConsoleProvider(LogLevel logLevel)
|
||||
{
|
||||
_LogLevel = logLevel;
|
||||
_Loggers = new ConcurrentDictionary<string, ConsoleLogger>();
|
||||
}
|
||||
|
||||
public ILogger CreateLogger(string categoryName) => _Loggers.GetOrAdd(categoryName, name => new ConsoleLogger(_LogLevel, name));
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_Loggers.Clear();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
}
|
36
Adaptation/_Tests/Shared/Log/DebugLogger.cs
Normal file
36
Adaptation/_Tests/Shared/Log/DebugLogger.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
|
||||
namespace Shared;
|
||||
|
||||
public class DebugLogger : ILogger
|
||||
{
|
||||
|
||||
public int EventId { get; set; }
|
||||
|
||||
private readonly string _Name;
|
||||
private readonly LogLevel _LogLevel;
|
||||
|
||||
public DebugLogger(LogLevel logLevel, string name)
|
||||
{
|
||||
_Name = name;
|
||||
EventId = 0;
|
||||
_LogLevel = logLevel;
|
||||
if (string.IsNullOrEmpty(_Name))
|
||||
{ }
|
||||
}
|
||||
|
||||
public IDisposable BeginScope<TState>(TState state) => null;
|
||||
|
||||
public bool IsEnabled(LogLevel logLevel) => logLevel >= _LogLevel;
|
||||
|
||||
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
|
||||
{
|
||||
if (IsEnabled(logLevel) && (EventId == 0 || EventId == eventId.Id))
|
||||
{
|
||||
string message = formatter(state, null);
|
||||
System.Diagnostics.Debug.Print(message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
27
Adaptation/_Tests/Shared/Log/DebugProvider.cs
Normal file
27
Adaptation/_Tests/Shared/Log/DebugProvider.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace Shared;
|
||||
|
||||
public class DebugProvider : ILoggerProvider
|
||||
{
|
||||
|
||||
private readonly LogLevel _LogLevel;
|
||||
private readonly ConcurrentDictionary<string, DebugLogger> _Loggers;
|
||||
|
||||
public DebugProvider(LogLevel logLevel)
|
||||
{
|
||||
_LogLevel = logLevel;
|
||||
_Loggers = new ConcurrentDictionary<string, DebugLogger>();
|
||||
}
|
||||
|
||||
public ILogger CreateLogger(string categoryName) => _Loggers.GetOrAdd(categoryName, name => new DebugLogger(_LogLevel, name));
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_Loggers.Clear();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
}
|
49
Adaptation/_Tests/Shared/Log/FeedbackLogger.cs
Normal file
49
Adaptation/_Tests/Shared/Log/FeedbackLogger.cs
Normal file
@ -0,0 +1,49 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
|
||||
namespace Shared;
|
||||
|
||||
public class FeedbackLogger : ILogger
|
||||
{
|
||||
|
||||
public int EventId { get; set; }
|
||||
|
||||
private readonly string _Name;
|
||||
private readonly LogLevel _LogLevel;
|
||||
private readonly IFeedback _Feedback;
|
||||
|
||||
public FeedbackLogger(LogLevel logLevel, IFeedback feedback, string name)
|
||||
{
|
||||
_Feedback = feedback;
|
||||
_Name = name;
|
||||
EventId = 0;
|
||||
_LogLevel = logLevel;
|
||||
if (string.IsNullOrEmpty(_Name))
|
||||
{ }
|
||||
}
|
||||
|
||||
public IDisposable BeginScope<TState>(TState state) => null;
|
||||
|
||||
public bool IsEnabled(LogLevel logLevel) => logLevel >= _LogLevel;
|
||||
|
||||
public void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
|
||||
{
|
||||
if (IsEnabled(logLevel) && (EventId == 0 || EventId == eventId.Id))
|
||||
{
|
||||
string message = formatter(state, null);
|
||||
int color = logLevel switch
|
||||
{
|
||||
LogLevel.Trace => -1,
|
||||
LogLevel.Debug => -1,
|
||||
LogLevel.Information => -16776961,
|
||||
LogLevel.Warning => -65281,
|
||||
LogLevel.Error => -65536,
|
||||
LogLevel.Critical => -65536,
|
||||
LogLevel.None => -1,
|
||||
_ => throw new Exception(),
|
||||
};
|
||||
_Feedback.Print(message, color);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
29
Adaptation/_Tests/Shared/Log/FeedbackProvider.cs
Normal file
29
Adaptation/_Tests/Shared/Log/FeedbackProvider.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace Shared;
|
||||
|
||||
public class FeedbackProvider : ILoggerProvider
|
||||
{
|
||||
|
||||
private readonly LogLevel _LogLevel;
|
||||
private readonly IFeedback _Feedback;
|
||||
private readonly ConcurrentDictionary<string, FeedbackLogger> _Loggers;
|
||||
|
||||
public FeedbackProvider(LogLevel logLevel, IFeedback feedback)
|
||||
{
|
||||
_LogLevel = logLevel;
|
||||
_Feedback = feedback;
|
||||
_Loggers = new ConcurrentDictionary<string, FeedbackLogger>();
|
||||
}
|
||||
|
||||
public ILogger CreateLogger(string categoryName) => _Loggers.GetOrAdd(categoryName, name => new FeedbackLogger(_LogLevel, _Feedback, name));
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_Loggers.Clear();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
}
|
11
Adaptation/_Tests/Shared/Log/IFeedback.cs
Normal file
11
Adaptation/_Tests/Shared/Log/IFeedback.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Shared;
|
||||
|
||||
public interface IFeedback
|
||||
{
|
||||
|
||||
List<string> Messages { get; }
|
||||
void Print(string message, int color);
|
||||
|
||||
}
|
139
Adaptation/_Tests/Shared/Log/Log.cs
Normal file
139
Adaptation/_Tests/Shared/Log/Log.cs
Normal file
@ -0,0 +1,139 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Shared;
|
||||
|
||||
public class Log
|
||||
{
|
||||
|
||||
#pragma warning disable CA2254
|
||||
#pragma warning disable IDE0060
|
||||
|
||||
private readonly ILogger _Logger;
|
||||
|
||||
public Log(ILogger logger) => _Logger = logger;
|
||||
|
||||
public void Black(object message) => _Logger.LogInformation(message.ToString());
|
||||
public void Blue(object message) => _Logger.LogInformation(message.ToString());
|
||||
public void Gray(object message) => _Logger.LogInformation(message.ToString());
|
||||
public void Green(object message) => _Logger.LogInformation(message.ToString());
|
||||
public void Magenta(string message, Exception exception) => _Logger.LogWarning(message, exception);
|
||||
public void Red(string message, Exception exception) => _Logger.LogError(message, exception);
|
||||
public void White(object message) => _Logger.LogInformation(message.ToString());
|
||||
public void Yellow(string message, Exception exception) => _Logger.LogWarning(message, exception);
|
||||
|
||||
//
|
||||
|
||||
public void DoLog(LogLevel logLevel, EventId eventId, Exception exception, string message, params object[] args) => _Logger.Log(logLevel, eventId, exception, message, args);
|
||||
public void DoLog(LogLevel logLevel, EventId eventId, string message, params object[] args) => _Logger.Log(logLevel, eventId, message, args);
|
||||
public void DoLog(LogLevel logLevel, Exception exception, string message, params object[] args) => _Logger.Log(logLevel, exception, message, args);
|
||||
public void DoLog(LogLevel logLevel, string message, params object[] args) => _Logger.Log(logLevel, message, args);
|
||||
public void LogCritical(EventId eventId, Exception exception, string message, params object[] args) => _Logger.LogCritical(eventId, exception, message, args);
|
||||
public void LogCritical(EventId eventId, string message, params object[] args) => _Logger.LogCritical(eventId, message, args);
|
||||
public void LogCritical(Exception exception, string message, params object[] args) => _Logger.LogCritical(exception, message, args);
|
||||
public void LogCritical(string message, params object[] args) => _Logger.LogCritical(message, args);
|
||||
public void LogDebug(EventId eventId, Exception exception, string message, params object[] args) => _Logger.LogDebug(eventId, exception, message, args);
|
||||
public void LogDebug(EventId eventId, string message, params object[] args) => _Logger.LogDebug(eventId, message, args);
|
||||
public void LogDebug(Exception exception, string message, params object[] args) => _Logger.LogDebug(exception, message, args);
|
||||
public void LogDebug(string message, params object[] args) => _Logger.LogDebug(message, args);
|
||||
public void LogError(EventId eventId, Exception exception, string message, params object[] args) => _Logger.LogError(eventId, exception, message, args);
|
||||
public void LogError(EventId eventId, string message, params object[] args) => _Logger.LogError(eventId, message, args);
|
||||
public void LogError(Exception exception, string message, params object[] args) => _Logger.LogError(message, args);
|
||||
public void LogError(string message, params object[] args) => _Logger.LogError(message, args);
|
||||
public void LogInformation(EventId eventId, Exception exception, string message, params object[] args) => _Logger.LogInformation(eventId, exception, message, args);
|
||||
public void LogInformation(EventId eventId, string message, params object[] args) => _Logger.LogInformation(eventId, message, args);
|
||||
public void LogInformation(Exception exception, string message, params object[] args) => _Logger.LogInformation(exception, message, args);
|
||||
public void LogInformation(string message, params object[] args) => _Logger.LogInformation(message, args);
|
||||
public void LogTrace(EventId eventId, Exception exception, string message, params object[] args) => _Logger.LogTrace(eventId, exception, message, args);
|
||||
public void LogTrace(EventId eventId, string message, params object[] args) => _Logger.LogTrace(eventId, message, args);
|
||||
public void LogTrace(Exception exception, string message, params object[] args) => _Logger.LogTrace(exception, message, args);
|
||||
public void LogTrace(string message, params object[] args) => _Logger.LogTrace(message, args);
|
||||
public void LogWarning(EventId eventId, Exception exception, string message, params object[] args) => _Logger.LogWarning(eventId, exception, message, args);
|
||||
public void LogWarning(EventId eventId, string message, params object[] args) => _Logger.LogWarning(eventId, message, args);
|
||||
public void LogWarning(Exception exception, string message, params object[] args) => _Logger.LogWarning(exception, message, args);
|
||||
public void LogWarning(string message, params object[] args) => _Logger.LogWarning(message, args);
|
||||
|
||||
//
|
||||
|
||||
public void Debug() => _Logger.LogDebug(string.Empty);
|
||||
public void Debug(object message) => _Logger.LogDebug(message.ToString());
|
||||
public void Debug(string message, Exception exception) => _Logger.LogDebug(exception, message);
|
||||
public void DebugFormat(IFormatProvider provider, string format, params object[] args) => _Logger.LogDebug(string.Format(provider, format, args));
|
||||
public void DebugFormat(string format, object arg0, object arg1, object arg2) => _Logger.LogDebug(string.Format(format, arg0, arg1, arg2));
|
||||
public void DebugFormat(string format, object arg0, object arg1) => _Logger.LogDebug(string.Format(format, arg0, arg1));
|
||||
public void DebugFormat(string format, object arg0) => _Logger.LogDebug(string.Format(format, arg0));
|
||||
public void DebugFormat(string format, params object[] args) => _Logger.LogDebug(string.Format(format, args));
|
||||
public void Error(object message) => _Logger.LogError(message.ToString());
|
||||
public void Error(string message, Exception exception) => _Logger.LogError(exception, message.ToString());
|
||||
public void ErrorFormat(IFormatProvider provider, string format, params object[] args) => _Logger.LogError(string.Format(provider, format, args));
|
||||
public void ErrorFormat(string format, object arg0, object arg1, object arg2) => _Logger.LogError(string.Format(format, arg0, arg1, arg2));
|
||||
public void ErrorFormat(string format, object arg0, object arg1) => _Logger.LogError(string.Format(format, arg0, arg1));
|
||||
public void ErrorFormat(string format, object arg0) => _Logger.LogError(string.Format(format, arg0));
|
||||
public void ErrorFormat(string format, params object[] args) => _Logger.LogError(string.Format(format, args));
|
||||
public void Fatal(object message) => _Logger.LogCritical(message.ToString());
|
||||
public void Fatal(string message, Exception exception) => _Logger.LogCritical(exception, message.ToString());
|
||||
public void FatalFormat(IFormatProvider provider, string format, params object[] args) => _Logger.LogCritical(string.Format(provider, format, args));
|
||||
public void FatalFormat(string format, object arg0, object arg1, object arg2) => _Logger.LogCritical(string.Format(format, arg0, arg1, arg2));
|
||||
public void FatalFormat(string format, object arg0, object arg1) => _Logger.LogCritical(string.Format(format, arg0, arg1));
|
||||
public void FatalFormat(string format, object arg0) => _Logger.LogCritical(string.Format(format, arg0));
|
||||
public void FatalFormat(string format, params object[] args) => _Logger.LogCritical(string.Format(format, args));
|
||||
public void Info(object message) => _Logger.LogInformation(message.ToString());
|
||||
public void Info(string message, Exception exception) => _Logger.LogInformation(exception, message.ToString());
|
||||
public void InfoFormat(IFormatProvider provider, string format, params object[] args) => _Logger.LogInformation(string.Format(provider, format, args));
|
||||
public void InfoFormat(string format, object arg0, object arg1, object arg2) => _Logger.LogInformation(string.Format(format, arg0, arg1, arg2));
|
||||
public void InfoFormat(string format, object arg0, object arg1) => _Logger.LogInformation(string.Format(format, arg0, arg1));
|
||||
public void InfoFormat(string format, object arg0) => _Logger.LogInformation(string.Format(format, arg0));
|
||||
public void InfoFormat(string format, params object[] args) => _Logger.LogInformation(string.Format(format, args));
|
||||
public void Warn(object message) => _Logger.LogWarning(message.ToString());
|
||||
public void Warn(string message, Exception exception) => _Logger.LogWarning(exception, message.ToString());
|
||||
public void WarnFormat(IFormatProvider provider, string format, params object[] args) => _Logger.LogWarning(string.Format(provider, format, args));
|
||||
public void WarnFormat(string format, object arg0, object arg1, object arg2) => _Logger.LogWarning(string.Format(format, arg0, arg1, arg2));
|
||||
public void WarnFormat(string format, object arg0, object arg1) => _Logger.LogWarning(string.Format(format, arg0, arg1));
|
||||
public void WarnFormat(string format, object arg0) => _Logger.LogWarning(string.Format(format, arg0));
|
||||
public void WarnFormat(string format, params object[] args) => _Logger.LogWarning(string.Format(format, args));
|
||||
|
||||
public static string GetWorkingDirectory(string executingAssemblyName, string subDirectoryName)
|
||||
{
|
||||
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(Path.Combine(Environment.GetFolderPath(specialFolder), subDirectoryName, executingAssemblyName));
|
||||
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;
|
||||
}
|
||||
if (string.IsNullOrEmpty(result))
|
||||
throw new Exception("Unable to set working directory!");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
111
Adaptation/_Tests/Shared/LoggingUnitTesting.cs
Normal file
111
Adaptation/_Tests/Shared/LoggingUnitTesting.cs
Normal file
@ -0,0 +1,111 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Shared;
|
||||
|
||||
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)
|
||||
{
|
||||
_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();
|
||||
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()
|
||||
{
|
||||
_LoggerFactory.Dispose();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
}
|
3056
Adaptation/_Tests/Shared/PasteSpecialXml/EAF XML API/CellInstance.cs
Normal file
3056
Adaptation/_Tests/Shared/PasteSpecialXml/EAF XML API/CellInstance.cs
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,23 @@
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace Shared.PasteSpecialXml.EAF.XML.API.ConfigurationData;
|
||||
|
||||
[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; }
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,962 @@
|
||||
namespace Shared.PasteSpecialXml.EAF.XML.API.EquipmentType;
|
||||
|
||||
// NOTE: Generated code may require at least .NET Framework 4.5 or .NET Core/Standard 2.0.
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.FactoryEntities")]
|
||||
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.FactoryEntities", IsNullable = false)]
|
||||
public partial class EquipmentTypeVersion
|
||||
{
|
||||
|
||||
#pragma warning disable IDE1006 // Naming Styles
|
||||
|
||||
private string createdByField;
|
||||
|
||||
private System.DateTime creationDateField;
|
||||
|
||||
private object descriptionField;
|
||||
|
||||
private ExtensionsVersionExtension[] extensionsField;
|
||||
|
||||
private System.DateTime freezeDateField;
|
||||
|
||||
private string frozenByField;
|
||||
|
||||
private byte idField;
|
||||
|
||||
private bool isFrozenField;
|
||||
|
||||
private bool isRetiredField;
|
||||
|
||||
private System.DateTime retireDateField;
|
||||
|
||||
private object retiredByField;
|
||||
|
||||
private SelectedDeploymentPackage[] deploymentPackagesField;
|
||||
|
||||
private EquipmentTypeVersionDictionaries dictionariesField;
|
||||
|
||||
private string nameField;
|
||||
|
||||
private EquipmentTypeVersionParentType parentTypeField;
|
||||
|
||||
private ParameterizedModelObjectDefinition[] equipmentComponentsField;
|
||||
|
||||
private EventActionSequenceDefinition[] eventActionSequencesField;
|
||||
|
||||
private object fileCommunicatorObjectTypesField;
|
||||
|
||||
private FileConfiguration fileConfigurationField;
|
||||
|
||||
private FileHandlerObjectTypes fileHandlerObjectTypesField;
|
||||
|
||||
private ParameterizedModelObjectDefinition[] transientEquipmentObjectTypesField;
|
||||
|
||||
private string id1Field;
|
||||
|
||||
private string i___typeField;
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.FactoryE" +
|
||||
"ntities")]
|
||||
public string CreatedBy
|
||||
{
|
||||
get => this.createdByField;
|
||||
set => this.createdByField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.FactoryE" +
|
||||
"ntities")]
|
||||
public System.DateTime CreationDate
|
||||
{
|
||||
get => this.creationDateField;
|
||||
set => this.creationDateField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.FactoryE" +
|
||||
"ntities", IsNullable = true)]
|
||||
public object Description
|
||||
{
|
||||
get => this.descriptionField;
|
||||
set => this.descriptionField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlArrayAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.FactoryE" +
|
||||
"ntities")]
|
||||
[System.Xml.Serialization.XmlArrayItemAttribute("VersionExtension", IsNullable = false)]
|
||||
public ExtensionsVersionExtension[] Extensions
|
||||
{
|
||||
get => this.extensionsField;
|
||||
set => this.extensionsField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.FactoryE" +
|
||||
"ntities")]
|
||||
public System.DateTime FreezeDate
|
||||
{
|
||||
get => this.freezeDateField;
|
||||
set => this.freezeDateField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.FactoryE" +
|
||||
"ntities")]
|
||||
public string FrozenBy
|
||||
{
|
||||
get => this.frozenByField;
|
||||
set => this.frozenByField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.FactoryE" +
|
||||
"ntities")]
|
||||
public byte Id
|
||||
{
|
||||
get => this.idField;
|
||||
set => this.idField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.FactoryE" +
|
||||
"ntities")]
|
||||
public bool IsFrozen
|
||||
{
|
||||
get => this.isFrozenField;
|
||||
set => this.isFrozenField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.FactoryE" +
|
||||
"ntities")]
|
||||
public bool IsRetired
|
||||
{
|
||||
get => this.isRetiredField;
|
||||
set => this.isRetiredField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.FactoryE" +
|
||||
"ntities")]
|
||||
public System.DateTime RetireDate
|
||||
{
|
||||
get => this.retireDateField;
|
||||
set => this.retireDateField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.FactoryE" +
|
||||
"ntities", IsNullable = true)]
|
||||
public object RetiredBy
|
||||
{
|
||||
get => this.retiredByField;
|
||||
set => this.retiredByField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlArrayItemAttribute("SelectedDeploymentPackage", Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.Deployme" +
|
||||
"nt", IsNullable = false)]
|
||||
public SelectedDeploymentPackage[] DeploymentPackages
|
||||
{
|
||||
get => this.deploymentPackagesField;
|
||||
set => this.deploymentPackagesField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public EquipmentTypeVersionDictionaries Dictionaries
|
||||
{
|
||||
get => this.dictionariesField;
|
||||
set => this.dictionariesField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public string Name
|
||||
{
|
||||
get => this.nameField;
|
||||
set => this.nameField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public EquipmentTypeVersionParentType ParentType
|
||||
{
|
||||
get => this.parentTypeField;
|
||||
set => this.parentTypeField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlArrayAttribute(Namespace = "http://schemas.datacontract.org/2004/07/EafRuntimeIfx.ManagementInterfaceIfx.File" +
|
||||
"Connector.EquipmentTypes")]
|
||||
[System.Xml.Serialization.XmlArrayItemAttribute("ParameterizedModelObjectDefinition", Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.CellAuto" +
|
||||
"mation", IsNullable = false)]
|
||||
public ParameterizedModelObjectDefinition[] EquipmentComponents
|
||||
{
|
||||
get => this.equipmentComponentsField;
|
||||
set => this.equipmentComponentsField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlArrayAttribute(Namespace = "http://schemas.datacontract.org/2004/07/EafRuntimeIfx.ManagementInterfaceIfx.File" +
|
||||
"Connector.EquipmentTypes")]
|
||||
[System.Xml.Serialization.XmlArrayItemAttribute("EventActionSequenceDefinition", Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.CellAuto" +
|
||||
"mation", IsNullable = false)]
|
||||
public EventActionSequenceDefinition[] EventActionSequences
|
||||
{
|
||||
get => this.eventActionSequencesField;
|
||||
set => this.eventActionSequencesField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.datacontract.org/2004/07/EafRuntimeIfx.ManagementInterfaceIfx.File" +
|
||||
"Connector.EquipmentTypes")]
|
||||
public object FileCommunicatorObjectTypes
|
||||
{
|
||||
get => this.fileCommunicatorObjectTypesField;
|
||||
set => this.fileCommunicatorObjectTypesField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.datacontract.org/2004/07/EafRuntimeIfx.ManagementInterfaceIfx.File" +
|
||||
"Connector.EquipmentTypes")]
|
||||
public FileConfiguration FileConfiguration
|
||||
{
|
||||
get => this.fileConfigurationField;
|
||||
set => this.fileConfigurationField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.datacontract.org/2004/07/EafRuntimeIfx.ManagementInterfaceIfx.File" +
|
||||
"Connector.EquipmentTypes")]
|
||||
public FileHandlerObjectTypes FileHandlerObjectTypes
|
||||
{
|
||||
get => this.fileHandlerObjectTypesField;
|
||||
set => this.fileHandlerObjectTypesField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlArrayAttribute(Namespace = "http://schemas.datacontract.org/2004/07/EafRuntimeIfx.ManagementInterfaceIfx.File" +
|
||||
"Connector.EquipmentTypes")]
|
||||
[System.Xml.Serialization.XmlArrayItemAttribute("ParameterizedModelObjectDefinition", Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.CellAuto" +
|
||||
"mation", IsNullable = false)]
|
||||
public ParameterizedModelObjectDefinition[] TransientEquipmentObjectTypes
|
||||
{
|
||||
get => this.transientEquipmentObjectTypesField;
|
||||
set => this.transientEquipmentObjectTypesField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlAttributeAttribute("Id", Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://schemas.microsoft.com/2003/10/Serialization/")]
|
||||
public string Id1
|
||||
{
|
||||
get => this.id1Field;
|
||||
set => this.id1Field = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlAttributeAttribute()]
|
||||
public string i___type
|
||||
{
|
||||
get => this.i___typeField;
|
||||
set => this.i___typeField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.Deployme" +
|
||||
"nt")]
|
||||
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.Deployme" +
|
||||
"nt", IsNullable = false)]
|
||||
public partial class SelectedDeploymentPackage
|
||||
{
|
||||
|
||||
private byte idField;
|
||||
|
||||
private string packageNameField;
|
||||
|
||||
private string packageVersionField;
|
||||
|
||||
/// <remarks/>
|
||||
public byte Id
|
||||
{
|
||||
get => this.idField;
|
||||
set => this.idField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public string PackageName
|
||||
{
|
||||
get => this.packageNameField;
|
||||
set => this.packageNameField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public string PackageVersion
|
||||
{
|
||||
get => this.packageVersionField;
|
||||
set => this.packageVersionField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.FactoryE" +
|
||||
"ntities")]
|
||||
public partial class ExtensionsVersionExtension
|
||||
{
|
||||
|
||||
private byte idField;
|
||||
|
||||
private string classNameField;
|
||||
|
||||
private object configurationField;
|
||||
|
||||
private string nameField;
|
||||
|
||||
private string id1Field;
|
||||
|
||||
private string i___typeField;
|
||||
|
||||
/// <remarks/>
|
||||
public byte Id
|
||||
{
|
||||
get => this.idField;
|
||||
set => this.idField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.Backbone" +
|
||||
"s")]
|
||||
public string ClassName
|
||||
{
|
||||
get => this.classNameField;
|
||||
set => this.classNameField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.Backbone" +
|
||||
"s", IsNullable = true)]
|
||||
public object Configuration
|
||||
{
|
||||
get => this.configurationField;
|
||||
set => this.configurationField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.Backbone" +
|
||||
"s")]
|
||||
public string Name
|
||||
{
|
||||
get => this.nameField;
|
||||
set => this.nameField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlAttributeAttribute("Id", Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://schemas.microsoft.com/2003/10/Serialization/")]
|
||||
public string Id1
|
||||
{
|
||||
get => this.id1Field;
|
||||
set => this.id1Field = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlAttributeAttribute()]
|
||||
public string i___type
|
||||
{
|
||||
get => this.i___typeField;
|
||||
set => this.i___typeField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.FactoryEntities")]
|
||||
public partial class EquipmentTypeVersionDictionaries
|
||||
{
|
||||
|
||||
private EquipmentTypeVersionDictionariesEquipmentTypeDictionaryReference equipmentTypeDictionaryReferenceField;
|
||||
|
||||
/// <remarks/>
|
||||
public EquipmentTypeVersionDictionariesEquipmentTypeDictionaryReference EquipmentTypeDictionaryReference
|
||||
{
|
||||
get => this.equipmentTypeDictionaryReferenceField;
|
||||
set => this.equipmentTypeDictionaryReferenceField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.FactoryEntities")]
|
||||
public partial class EquipmentTypeVersionDictionariesEquipmentTypeDictionaryReference
|
||||
{
|
||||
|
||||
private string dictionaryNameField;
|
||||
|
||||
private string dictionaryVersionField;
|
||||
|
||||
private byte idField;
|
||||
|
||||
private string id1Field;
|
||||
|
||||
/// <remarks/>
|
||||
public string DictionaryName
|
||||
{
|
||||
get => this.dictionaryNameField;
|
||||
set => this.dictionaryNameField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public string DictionaryVersion
|
||||
{
|
||||
get => this.dictionaryVersionField;
|
||||
set => this.dictionaryVersionField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public byte Id
|
||||
{
|
||||
get => this.idField;
|
||||
set => this.idField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlAttributeAttribute("Id", Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://schemas.microsoft.com/2003/10/Serialization/")]
|
||||
public string Id1
|
||||
{
|
||||
get => this.id1Field;
|
||||
set => this.id1Field = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.FactoryEntities")]
|
||||
public partial class EquipmentTypeVersionParentType
|
||||
{
|
||||
|
||||
private byte idField;
|
||||
|
||||
private string nameField;
|
||||
|
||||
private string id1Field;
|
||||
|
||||
/// <remarks/>
|
||||
public byte Id
|
||||
{
|
||||
get => this.idField;
|
||||
set => this.idField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public string Name
|
||||
{
|
||||
get => this.nameField;
|
||||
set => this.nameField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlAttributeAttribute("Id", Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://schemas.microsoft.com/2003/10/Serialization/")]
|
||||
public string Id1
|
||||
{
|
||||
get => this.id1Field;
|
||||
set => this.id1Field = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.CellAuto" +
|
||||
"mation")]
|
||||
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.CellAuto" +
|
||||
"mation", IsNullable = false)]
|
||||
public partial class ParameterizedModelObjectDefinition
|
||||
{
|
||||
|
||||
private byte idField;
|
||||
|
||||
private string nameField;
|
||||
|
||||
private ParameterizedModelObjectDefinitionModelObjectParameterDefinition[] parametersField;
|
||||
|
||||
private string typeField;
|
||||
|
||||
private string id1Field;
|
||||
|
||||
/// <remarks/>
|
||||
public byte Id
|
||||
{
|
||||
get => this.idField;
|
||||
set => this.idField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public string Name
|
||||
{
|
||||
get => this.nameField;
|
||||
set => this.nameField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlArrayItemAttribute("ModelObjectParameterDefinition", IsNullable = false)]
|
||||
public ParameterizedModelObjectDefinitionModelObjectParameterDefinition[] Parameters
|
||||
{
|
||||
get => this.parametersField;
|
||||
set => this.parametersField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public string Type
|
||||
{
|
||||
get => this.typeField;
|
||||
set => this.typeField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlAttributeAttribute("Id", Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://schemas.microsoft.com/2003/10/Serialization/")]
|
||||
public string Id1
|
||||
{
|
||||
get => this.id1Field;
|
||||
set => this.id1Field = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.CellAuto" +
|
||||
"mation")]
|
||||
public partial class ParameterizedModelObjectDefinitionModelObjectParameterDefinition
|
||||
{
|
||||
|
||||
private string enumTypeField;
|
||||
|
||||
private byte idField;
|
||||
|
||||
private string nameField;
|
||||
|
||||
private string valueField;
|
||||
|
||||
private string valueTypeField;
|
||||
|
||||
private string id1Field;
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(IsNullable = true)]
|
||||
public string EnumType
|
||||
{
|
||||
get => this.enumTypeField;
|
||||
set => this.enumTypeField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public byte Id
|
||||
{
|
||||
get => this.idField;
|
||||
set => this.idField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public string Name
|
||||
{
|
||||
get => this.nameField;
|
||||
set => this.nameField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public string Value
|
||||
{
|
||||
get => this.valueField;
|
||||
set => this.valueField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public string ValueType
|
||||
{
|
||||
get => this.valueTypeField;
|
||||
set => this.valueTypeField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlAttributeAttribute("Id", Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://schemas.microsoft.com/2003/10/Serialization/")]
|
||||
public string Id1
|
||||
{
|
||||
get => this.id1Field;
|
||||
set => this.id1Field = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.CellAuto" +
|
||||
"mation")]
|
||||
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.CellAuto" +
|
||||
"mation", IsNullable = false)]
|
||||
public partial class EventActionSequenceDefinition
|
||||
{
|
||||
|
||||
private EventActionSequenceDefinitionEventActionParameterDefinition[] actionsField;
|
||||
|
||||
private string eventTypeField;
|
||||
|
||||
private string handledEventField;
|
||||
|
||||
private byte idField;
|
||||
|
||||
private string id1Field;
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlArrayItemAttribute("EventActionParameterDefinition", IsNullable = false)]
|
||||
public EventActionSequenceDefinitionEventActionParameterDefinition[] Actions
|
||||
{
|
||||
get => this.actionsField;
|
||||
set => this.actionsField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public string EventType
|
||||
{
|
||||
get => this.eventTypeField;
|
||||
set => this.eventTypeField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public string HandledEvent
|
||||
{
|
||||
get => this.handledEventField;
|
||||
set => this.handledEventField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public byte Id
|
||||
{
|
||||
get => this.idField;
|
||||
set => this.idField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlAttributeAttribute("Id", Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://schemas.microsoft.com/2003/10/Serialization/")]
|
||||
public string Id1
|
||||
{
|
||||
get => this.id1Field;
|
||||
set => this.id1Field = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.datacontract.org/2004/07/EafRuntimeIfx.ManagementInterfaceIfx.File" +
|
||||
"Connector.EquipmentTypes")]
|
||||
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://schemas.datacontract.org/2004/07/EafRuntimeIfx.ManagementInterfaceIfx.File" +
|
||||
"Connector.EquipmentTypes", IsNullable = false)]
|
||||
public class FileConfiguration
|
||||
{
|
||||
|
||||
private string idField;
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlAttributeAttribute(Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://schemas.microsoft.com/2003/10/Serialization/")]
|
||||
public string Id
|
||||
{
|
||||
get => this.idField;
|
||||
set => this.idField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.datacontract.org/2004/07/EafRuntimeIfx.ManagementInterfaceIfx.File" +
|
||||
"Connector.EquipmentTypes")]
|
||||
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://schemas.datacontract.org/2004/07/EafRuntimeIfx.ManagementInterfaceIfx.File" +
|
||||
"Connector.EquipmentTypes", IsNullable = false)]
|
||||
public class FileHandlerObjectTypes
|
||||
{
|
||||
|
||||
private ParameterizedModelObjectDefinition parameterizedModelObjectDefinitionField;
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.CellAuto" +
|
||||
"mation")]
|
||||
public ParameterizedModelObjectDefinition ParameterizedModelObjectDefinition
|
||||
{
|
||||
get => this.parameterizedModelObjectDefinitionField;
|
||||
set => this.parameterizedModelObjectDefinitionField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.FactoryE" +
|
||||
"ntities")]
|
||||
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.FactoryE" +
|
||||
"ntities", IsNullable = false)]
|
||||
public partial class Extensions
|
||||
{
|
||||
|
||||
private ExtensionsVersionExtension[] versionExtensionField;
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute("VersionExtension")]
|
||||
public ExtensionsVersionExtension[] VersionExtension
|
||||
{
|
||||
get => this.versionExtensionField;
|
||||
set => this.versionExtensionField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.datacontract.org/2004/07/EafRuntimeIfx.ManagementInterfaceIfx.File" +
|
||||
"Connector.EquipmentTypes")]
|
||||
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://schemas.datacontract.org/2004/07/EafRuntimeIfx.ManagementInterfaceIfx.File" +
|
||||
"Connector.EquipmentTypes", IsNullable = false)]
|
||||
public partial class EquipmentComponents
|
||||
{
|
||||
|
||||
private ParameterizedModelObjectDefinition[] parameterizedModelObjectDefinitionField;
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute("ParameterizedModelObjectDefinition", Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.CellAuto" +
|
||||
"mation")]
|
||||
public ParameterizedModelObjectDefinition[] ParameterizedModelObjectDefinition
|
||||
{
|
||||
get => this.parameterizedModelObjectDefinitionField;
|
||||
set => this.parameterizedModelObjectDefinitionField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.datacontract.org/2004/07/EafRuntimeIfx.ManagementInterfaceIfx.File" +
|
||||
"Connector.EquipmentTypes")]
|
||||
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://schemas.datacontract.org/2004/07/EafRuntimeIfx.ManagementInterfaceIfx.File" +
|
||||
"Connector.EquipmentTypes", IsNullable = false)]
|
||||
public partial class EventActionSequences
|
||||
{
|
||||
|
||||
private EventActionSequenceDefinition[] eventActionSequenceDefinitionField;
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute("EventActionSequenceDefinition", Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.CellAuto" +
|
||||
"mation")]
|
||||
public EventActionSequenceDefinition[] EventActionSequenceDefinition
|
||||
{
|
||||
get => this.eventActionSequenceDefinitionField;
|
||||
set => this.eventActionSequenceDefinitionField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.datacontract.org/2004/07/EafRuntimeIfx.ManagementInterfaceIfx.File" +
|
||||
"Connector.EquipmentTypes")]
|
||||
[System.Xml.Serialization.XmlRootAttribute(Namespace = "http://schemas.datacontract.org/2004/07/EafRuntimeIfx.ManagementInterfaceIfx.File" +
|
||||
"Connector.EquipmentTypes", IsNullable = false)]
|
||||
public partial class TransientEquipmentObjectTypes
|
||||
{
|
||||
|
||||
private ParameterizedModelObjectDefinition[] parameterizedModelObjectDefinitionField;
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute("ParameterizedModelObjectDefinition", Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.CellAuto" +
|
||||
"mation")]
|
||||
public ParameterizedModelObjectDefinition[] ParameterizedModelObjectDefinition
|
||||
{
|
||||
get => this.parameterizedModelObjectDefinitionField;
|
||||
set => this.parameterizedModelObjectDefinitionField = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.CellAuto" +
|
||||
"mation")]
|
||||
public partial class EventActionSequenceDefinitionEventActionParameterDefinition
|
||||
{
|
||||
|
||||
private byte idField;
|
||||
|
||||
private object nameField;
|
||||
|
||||
private EventActionSequenceDefinitionEventActionParameterDefinitionModelObjectParameterDefinition[] parametersField;
|
||||
|
||||
private string typeField;
|
||||
|
||||
private byte positionField;
|
||||
|
||||
private string id1Field;
|
||||
|
||||
/// <remarks/>
|
||||
public byte Id
|
||||
{
|
||||
get => this.idField;
|
||||
set => this.idField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(IsNullable = true)]
|
||||
public object Name
|
||||
{
|
||||
get => this.nameField;
|
||||
set => this.nameField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlArrayItemAttribute("ModelObjectParameterDefinition", IsNullable = false)]
|
||||
public EventActionSequenceDefinitionEventActionParameterDefinitionModelObjectParameterDefinition[] Parameters
|
||||
{
|
||||
get => this.parametersField;
|
||||
set => this.parametersField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public string Type
|
||||
{
|
||||
get => this.typeField;
|
||||
set => this.typeField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public byte Position
|
||||
{
|
||||
get => this.positionField;
|
||||
set => this.positionField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlAttributeAttribute("Id", Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://schemas.microsoft.com/2003/10/Serialization/")]
|
||||
public string Id1
|
||||
{
|
||||
get => this.id1Field;
|
||||
set => this.id1Field = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.SerializableAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://schemas.datacontract.org/2004/07/Eaf.Management.ConfigurationData.CellAuto" +
|
||||
"mation")]
|
||||
public partial class EventActionSequenceDefinitionEventActionParameterDefinitionModelObjectParameterDefinition
|
||||
{
|
||||
|
||||
private object categoryField;
|
||||
|
||||
private object descriptionField;
|
||||
|
||||
private object displayNameField;
|
||||
|
||||
private object enumTypeField;
|
||||
|
||||
private byte idField;
|
||||
|
||||
private bool isMandatoryField;
|
||||
|
||||
private string nameField;
|
||||
|
||||
private byte orderField;
|
||||
|
||||
private string valueField;
|
||||
|
||||
private string valueTypeField;
|
||||
|
||||
private string id1Field;
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(IsNullable = true)]
|
||||
public object Category
|
||||
{
|
||||
get => this.categoryField;
|
||||
set => this.categoryField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(IsNullable = true)]
|
||||
public object Description
|
||||
{
|
||||
get => this.descriptionField;
|
||||
set => this.descriptionField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(IsNullable = true)]
|
||||
public object DisplayName
|
||||
{
|
||||
get => this.displayNameField;
|
||||
set => this.displayNameField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlElementAttribute(IsNullable = true)]
|
||||
public object EnumType
|
||||
{
|
||||
get => this.enumTypeField;
|
||||
set => this.enumTypeField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public byte Id
|
||||
{
|
||||
get => this.idField;
|
||||
set => this.idField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public bool IsMandatory
|
||||
{
|
||||
get => this.isMandatoryField;
|
||||
set => this.isMandatoryField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public string Name
|
||||
{
|
||||
get => this.nameField;
|
||||
set => this.nameField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public byte Order
|
||||
{
|
||||
get => this.orderField;
|
||||
set => this.orderField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public string Value
|
||||
{
|
||||
get => this.valueField;
|
||||
set => this.valueField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public string ValueType
|
||||
{
|
||||
get => this.valueTypeField;
|
||||
set => this.valueTypeField = value;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Xml.Serialization.XmlAttributeAttribute("Id", Form = System.Xml.Schema.XmlSchemaForm.Qualified, Namespace = "http://schemas.microsoft.com/2003/10/Serialization/")]
|
||||
public string Id1
|
||||
{
|
||||
get => this.id1Field;
|
||||
set => this.id1Field = value;
|
||||
}
|
||||
}
|
90
Adaptation/_Tests/Shared/UnitTesting.cs
Normal file
90
Adaptation/_Tests/Shared/UnitTesting.cs
Normal file
@ -0,0 +1,90 @@
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
|
||||
namespace Shared;
|
||||
|
||||
public class UnitTesting
|
||||
{
|
||||
|
||||
protected readonly IsEnvironment _IsEnvironment;
|
||||
|
||||
public IsEnvironment IsEnvironment => _IsEnvironment;
|
||||
|
||||
public UnitTesting(TestContext testContext, Type declaringType)
|
||||
{
|
||||
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 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 GetProjectDirectory(TestContext testContext)
|
||||
{
|
||||
string result;
|
||||
string[] checkFiles = null;
|
||||
result = Path.GetDirectoryName(testContext.DeploymentDirectory);
|
||||
for (int i = 0; i < int.MaxValue; i++)
|
||||
{
|
||||
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\": {Environment.ProcessId}").
|
||||
AppendLine(" }").
|
||||
AppendLine(" ]").
|
||||
AppendLine("}");
|
||||
return result.ToString();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user