dotnet test -c Release

Passed!  - Failed:     0, Passed:    31, Skipped:    71, Total:   102
This commit is contained in:
2023-01-26 14:10:38 -07:00
parent f38a95a066
commit efb32d131d
16 changed files with 497 additions and 432 deletions

View File

@ -6,7 +6,7 @@ using System.Diagnostics;
using System.IO;
using System.Reflection;
namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_47_1;
namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_47_0;
[TestClass]
public class BIORAD2 : EAFLoggingUnitTesting
@ -18,6 +18,8 @@ public class BIORAD2 : EAFLoggingUnitTesting
internal static string DummyRoot { get; private set; }
internal static BIORAD2 EAFLoggingUnitTesting { get; private set; }
static BIORAD2() => DummyRoot = @"\\messv02ecc1.ec.local\EC_Characterization_Si\Dummy";
public BIORAD2() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
{
if (EAFLoggingUnitTesting is null)
@ -45,11 +47,11 @@ public class BIORAD2 : EAFLoggingUnitTesting
EAFLoggingUnitTesting?.Dispose();
}
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Staging__v2_47_1__BIORAD2__QS408M()
public void Staging__v2_47_0__BIORAD2__QS408M()
{
string check = "*.txt";
MethodBase methodBase = new StackFrame().GetMethod();

View File

@ -6,7 +6,7 @@ using System.Diagnostics;
using System.IO;
using System.Reflection;
namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_47_1;
namespace Adaptation._Tests.CreateSelfDescription.Staging.v2_47_0;
[TestClass]
public class BIORAD3 : EAFLoggingUnitTesting
@ -18,6 +18,8 @@ public class BIORAD3 : EAFLoggingUnitTesting
internal static string DummyRoot { get; private set; }
internal static BIORAD3 EAFLoggingUnitTesting { get; private set; }
static BIORAD3() => DummyRoot = @"\\messv02ecc1.ec.local\EC_Characterization_Si\Dummy";
public BIORAD3() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
{
if (EAFLoggingUnitTesting is null)
@ -45,11 +47,11 @@ public class BIORAD3 : EAFLoggingUnitTesting
EAFLoggingUnitTesting?.Dispose();
}
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Staging__v2_47_1__BIORAD3__QS408M()
public void Staging__v2_47_0__BIORAD3__QS408M()
{
string check = "*.txt";
MethodBase methodBase = new StackFrame().GetMethod();

View File

@ -18,6 +18,8 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting
internal static string DummyRoot { get; private set; }
internal static MET08THFTIRQS408M EAFLoggingUnitTesting { get; private set; }
static MET08THFTIRQS408M() => DummyRoot = @"\\messv02ecc1.ec.local\EC_Characterization_Si\Dummy";
public MET08THFTIRQS408M() : base(DummyRoot, testContext: null, declaringType: null, skipEquipmentDictionary: false)
{
if (EAFLoggingUnitTesting is null)
@ -45,7 +47,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting
EAFLoggingUnitTesting?.Dispose();
}
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
@ -58,7 +60,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
@ -71,7 +73,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
@ -84,7 +86,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
@ -97,7 +99,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
@ -110,7 +112,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
@ -123,7 +125,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
@ -136,7 +138,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
@ -149,7 +151,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
@ -162,7 +164,7 @@ public class MET08THFTIRQS408M : EAFLoggingUnitTesting
EAFLoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]

View File

@ -0,0 +1,27 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Adaptation._Tests.Extract.Staging.v2_47_0;
[TestClass]
public class BIORAD2
{
#pragma warning disable CA2254
#pragma warning disable IDE0060
private static CreateSelfDescription.Staging.v2_47_0.BIORAD2 _BIORAD2;
[ClassInitialize]
public static void ClassInitialize(TestContext testContext)
{
CreateSelfDescription.Staging.v2_47_0.BIORAD2.ClassInitialize(testContext);
_BIORAD2 = CreateSelfDescription.Staging.v2_47_0.BIORAD2.EAFLoggingUnitTesting;
}
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Staging__v2_47_0__BIORAD2__QS408M() => _BIORAD2.Staging__v2_47_0__BIORAD2__QS408M();
}

View File

@ -5,7 +5,7 @@ using System;
using System.Diagnostics;
using System.Reflection;
namespace Adaptation._Tests.Extract.Staging.v2_47_1;
namespace Adaptation._Tests.Extract.Staging.v2_47_0;
[TestClass]
public class BIORAD3
@ -14,30 +14,31 @@ public class BIORAD3
#pragma warning disable CA2254
#pragma warning disable IDE0060
private static CreateSelfDescription.Staging.v2_47_1.BIORAD3 _BIORAD3;
private static CreateSelfDescription.Staging.v2_47_0.BIORAD3 _BIORAD3;
[ClassInitialize]
public static void ClassInitialize(TestContext testContext)
{
CreateSelfDescription.Staging.v2_47_1.BIORAD3.ClassInitialize(testContext);
_BIORAD3 = CreateSelfDescription.Staging.v2_47_1.BIORAD3.EAFLoggingUnitTesting;
CreateSelfDescription.Staging.v2_47_0.BIORAD3.ClassInitialize(testContext);
_BIORAD3 = CreateSelfDescription.Staging.v2_47_0.BIORAD3.EAFLoggingUnitTesting;
}
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Staging__v2_47_1__BIORAD3__QS408M() => _BIORAD3.Staging__v2_47_1__BIORAD3__QS408M();
public void Staging__v2_47_0__BIORAD3__QS408M() => _BIORAD3.Staging__v2_47_0__BIORAD3__QS408M();
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Staging__v2_47_1__BIORAD3__QS408M637406016892454000__ReactorAndRDS()
public void Staging__v2_47_0__BIORAD3__QS408M637406016892454000__ReactorAndRDS()
{
DateTime dateTime;
string check = "*.txt";
_BIORAD3.Staging__v2_47_1__BIORAD3__QS408M();
bool validatePDSF = false;
_BIORAD3.Staging__v2_47_0__BIORAD3__QS408M();
MethodBase methodBase = new StackFrame().GetMethod();
string[] variables = _BIORAD3.AdaptationTesting.GetVariables(methodBase, check);
IFileRead fileRead = _BIORAD3.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
@ -46,7 +47,7 @@ public class BIORAD3
Assert.IsTrue(dateTime == logistics.DateTimeFromSequence);
dateTime = FileHandlers.QS408M.ProcessData.GetDateTime(logistics, tickOffset: 0, dateTimeText: "Tue Nov 10 12:03:56 1970");
Assert.IsTrue(dateTime == logistics.DateTimeFromSequence);
_ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics);
_ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics, validatePDSF);
}
}

View File

@ -1,27 +0,0 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Adaptation._Tests.Extract.Staging.v2_47_1;
[TestClass]
public class BIORAD2
{
#pragma warning disable CA2254
#pragma warning disable IDE0060
private static CreateSelfDescription.Staging.v2_47_1.BIORAD2 _BIORAD2;
[ClassInitialize]
public static void ClassInitialize(TestContext testContext)
{
CreateSelfDescription.Staging.v2_47_1.BIORAD2.ClassInitialize(testContext);
_BIORAD2 = CreateSelfDescription.Staging.v2_47_1.BIORAD2.EAFLoggingUnitTesting;
}
#if true
[Ignore]
#endif
[TestMethod]
public void Staging__v2_47_1__BIORAD2__QS408M() => _BIORAD2.Staging__v2_47_1__BIORAD2__QS408M();
}

View File

@ -23,31 +23,31 @@ public class MET08THFTIRQS408M
_MET08THFTIRQS408M = CreateSelfDescription.Staging.v2_47_1.MET08THFTIRQS408M.EAFLoggingUnitTesting;
}
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Staging__v2_47_1__MET08THFTIRQS408M__MoveMatchingFiles() => _MET08THFTIRQS408M.Staging__v2_47_1__MET08THFTIRQS408M__MoveMatchingFiles();
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Staging__v2_47_1__MET08THFTIRQS408M__OpenInsightMetrologyViewer() => _MET08THFTIRQS408M.Staging__v2_47_1__MET08THFTIRQS408M__OpenInsightMetrologyViewer();
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Staging__v2_47_1__MET08THFTIRQS408M__IQSSi() => _MET08THFTIRQS408M.Staging__v2_47_1__MET08THFTIRQS408M__IQSSi();
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Staging__v2_47_1__MET08THFTIRQS408M__OpenInsight() => _MET08THFTIRQS408M.Staging__v2_47_1__MET08THFTIRQS408M__OpenInsight();
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
@ -67,37 +67,37 @@ public class MET08THFTIRQS408M
_ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics);
}
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Staging__v2_47_1__MET08THFTIRQS408M__OpenInsightMetrologyViewerAttachments() => _MET08THFTIRQS408M.Staging__v2_47_1__MET08THFTIRQS408M__OpenInsightMetrologyViewerAttachments();
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Staging__v2_47_1__MET08THFTIRQS408M__APC() => _MET08THFTIRQS408M.Staging__v2_47_1__MET08THFTIRQS408M__APC();
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Staging__v2_47_1__MET08THFTIRQS408M__SPaCe() => _MET08THFTIRQS408M.Staging__v2_47_1__MET08THFTIRQS408M__SPaCe();
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Staging__v2_47_1__MET08THFTIRQS408M__Processed() => _MET08THFTIRQS408M.Staging__v2_47_1__MET08THFTIRQS408M__Processed();
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Staging__v2_47_1__MET08THFTIRQS408M__Archive() => _MET08THFTIRQS408M.Staging__v2_47_1__MET08THFTIRQS408M__Archive();
#if true
#if DEBUG
[Ignore]
#endif
[TestMethod]

View File

@ -343,7 +343,7 @@ public class AdaptationTesting : ISMTP
return result as T;
}
protected static CellInstanceVersion GetCellInstanceVersion(string url)
public static CellInstanceVersion GetCellInstanceVersion(string url)
{
CellInstanceVersion result;
byte[] byteArray;
@ -874,7 +874,7 @@ public class AdaptationTesting : ISMTP
return result;
}
protected Dictionary<string, object> GetKeyValuePairs(string cellInstanceName, string cellInstanceVersionName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, List<Tuple<string, string>> equipmentDictionaryIsAlwaysEnabledEvents)
protected Dictionary<string, object> GetKeyValuePairs(string cellInstanceName, string cellInstanceVersionName, string cellInstanceConnectionName, FileConnectorConfiguration fileConnectorConfiguration, string equipmentTypeName, string parameterizedModelObjectDefinitionType, IList<ModelObjectParameterDefinition> modelObjectParameters, string equipmentDictionaryName, List<Tuple<string, string>> equipmentDictionaryIsAlwaysEnabledEvents, int edaConnectionPortNumber)
{
Dictionary<string, object> results = new()
{
@ -883,6 +883,7 @@ public class AdaptationTesting : ISMTP
{ nameof(cellInstanceName), cellInstanceName },
{ nameof(equipmentTypeName), equipmentTypeName },
{ nameof(cellInstanceVersionName), cellInstanceVersionName },
{ nameof(edaConnectionPortNumber), edaConnectionPortNumber },
{ nameof(equipmentDictionaryName), equipmentDictionaryName },
{ nameof(cellInstanceConnectionName), cellInstanceConnectionName },
{ nameof(FileConnectorConfiguration), fileConnectorConfiguration },
@ -930,7 +931,7 @@ public class AdaptationTesting : ISMTP
Tuple<string, IList<ModelObjectParameterDefinition>> modelObjectParametersTuple = GetModelObjectParameters(equipmentTypeVersionTuple);
Tuple<string, string, string, EquipmentDictionaryVersion> equipmentDictionaryVersionTuple = GetEquipmentDictionaryVersionTuple(cellInstanceVersionTuple.Item2, mbn.CellInstanceConnectionName, equipmentTypeVersionTuple.Item4);
Tuple<string, List<Tuple<string, string>>> equipmentDictionaryIsAlwaysEnabledEventsTuple = GetEquipmentDictionaryIsAlwaysEnabledEventsTuple(equipmentDictionaryVersionTuple);
Dictionary<string, object> objects = GetKeyValuePairs(mbn.CellInstanceName, mbn.CellInstanceVersionName, mbn.CellInstanceConnectionName, fileConnectorConfigurationTuple.Item2, equipmentTypeVersionTuple.Item2, parameterizedModelObjectDefinitionTypeTuple.Item2, modelObjectParametersTuple.Item2, equipmentDictionaryVersionTuple.Item2, equipmentDictionaryIsAlwaysEnabledEventsTuple.Item2);
Dictionary<string, object> objects = GetKeyValuePairs(mbn.CellInstanceName, mbn.CellInstanceVersionName, mbn.CellInstanceConnectionName, fileConnectorConfigurationTuple.Item2, equipmentTypeVersionTuple.Item2, parameterizedModelObjectDefinitionTypeTuple.Item2, modelObjectParametersTuple.Item2, equipmentDictionaryVersionTuple.Item2, equipmentDictionaryIsAlwaysEnabledEventsTuple.Item2, cellInstanceVersionTuple.Item2.EdaConnection.PortNumber);
string json = JsonSerializer.Serialize(objects, new JsonSerializerOptions { WriteIndented = true });
results = new string[] { fileInfo.FullName, json };
return results;

View File

@ -0,0 +1,72 @@
using Adaptation._Tests.Shared;
using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Text;
namespace Adaptation._Tests.Static;
[TestClass]
public class MET08THFTIRQS408M : LoggingUnitTesting, IDisposable
{
#pragma warning disable CA2254
#pragma warning disable IDE0060
internal static MET08THFTIRQS408M LoggingUnitTesting { get; private set; }
public MET08THFTIRQS408M() : base(testContext: null, declaringType: null)
{
if (LoggingUnitTesting is null)
throw new Exception();
}
public MET08THFTIRQS408M(TestContext testContext) : base(testContext, new StackFrame().GetMethod().DeclaringType)
{
}
[ClassInitialize]
public static void ClassInitialize(TestContext testContext) => LoggingUnitTesting ??= new MET08THFTIRQS408M(testContext);
[ClassCleanup()]
public static void ClassCleanup()
{
LoggingUnitTesting.Logger?.LogInformation("Cleanup");
LoggingUnitTesting?.Dispose();
}
[TestMethod]
public void TestDateTime()
{
DateTime dateTime = DateTime.Now;
Assert.IsTrue(dateTime.ToString("M/d/yyyy h:mm:ss tt") == dateTime.ToString());
}
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Staging()
{
MethodBase methodBase = new StackFrame().GetMethod();
StringBuilder results = new();
(string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[]
{
new("MET08THFTIRQS408M", "v2.47.1"),
};
string staging = "http://mestsa07ec.ec.local:9003/CellInstanceServiceV2";
Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion;
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
foreach ((string cellInstanceName, string cellInstanceVersionName) in collection)
{
cellInstanceVersion = AdaptationTesting.GetCellInstanceVersion($"{staging}/{cellInstanceName}/{cellInstanceVersionName}/configuration");
_ = results.AppendLine($"{cellInstanceName}\t{cellInstanceVersionName}\t{cellInstanceVersion.EdaConnection.PortNumber}");
}
File.WriteAllText($"D:/Tmp/{methodBase.Module.Name}-{methodBase.ReflectedType.Name}-{methodBase.Name}.tsv", results.ToString());
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
}

View File

@ -3,7 +3,9 @@ using Microsoft.Extensions.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Text;
namespace Adaptation._Tests.Static;
@ -126,4 +128,29 @@ public class QS408M : LoggingUnitTesting, IDisposable
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
#if DEBUG
[Ignore]
#endif
[TestMethod]
public void Staging()
{
MethodBase methodBase = new StackFrame().GetMethod();
StringBuilder results = new();
(string cellInstanceName, string cellInstanceVersionName)[] collection = new (string, string)[]
{
new("BIORAD2", "v2.47.0"),
new("BIORAD3", "v2.47.0"),
};
string staging = "http://mestsa07ec.ec.local:9003/CellInstanceServiceV2";
Shared.PasteSpecialXml.EAF.XML.API.CellInstance.CellInstanceVersion cellInstanceVersion;
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Getting configuration"));
foreach ((string cellInstanceName, string cellInstanceVersionName) in collection)
{
cellInstanceVersion = AdaptationTesting.GetCellInstanceVersion($"{staging}/{cellInstanceName}/{cellInstanceVersionName}/configuration");
_ = results.AppendLine($"{cellInstanceName}\t{cellInstanceVersionName}\t{cellInstanceVersion.EdaConnection.PortNumber}");
}
File.WriteAllText($"D:/Tmp/{methodBase.Module.Name}-{methodBase.ReflectedType.Name}-{methodBase.Name}.tsv", results.ToString());
LoggingUnitTesting.Logger.LogInformation(string.Concat(methodBase.Name, " - Exit"));
}
}