ProcessDataStandardFormat over Tuple MoveMatchingFiles to use ProcessDataStandardFormatMapping
262 lines
11 KiB
C#
262 lines
11 KiB
C#
#if true
|
|
using Adaptation.FileHandlers.json.WorkItems;
|
|
using Adaptation.FileHandlers.Priority;
|
|
using Adaptation.Shared;
|
|
using Adaptation.Shared.Methods;
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.Diagnostics;
|
|
using System.IO;
|
|
using System.Reflection;
|
|
using System.Text.Json;
|
|
|
|
namespace Adaptation._Tests.Extract.Development.v2_59_0;
|
|
|
|
[TestClass]
|
|
public class MESAFIBACKLOG
|
|
{
|
|
|
|
#pragma warning disable CA2254
|
|
#pragma warning disable IDE0060
|
|
|
|
private static CreateSelfDescription.Development.v2_59_0.MESAFIBACKLOG _MESAFIBACKLOG;
|
|
|
|
[ClassInitialize]
|
|
public static void ClassInitialize(TestContext testContext)
|
|
{
|
|
CreateSelfDescription.Development.v2_59_0.MESAFIBACKLOG.ClassInitialize(testContext);
|
|
_MESAFIBACKLOG = CreateSelfDescription.Development.v2_59_0.MESAFIBACKLOG.EAFLoggingUnitTesting;
|
|
}
|
|
|
|
private static void NonThrowTryCatch()
|
|
{
|
|
try
|
|
{ throw new Exception(); }
|
|
catch (Exception) { }
|
|
}
|
|
|
|
#if DEBUG
|
|
[Ignore]
|
|
#endif
|
|
[TestMethod]
|
|
public void Development__v2_59_0__MESAFIBACKLOG__Kanban() => _MESAFIBACKLOG.Development__v2_59_0__MESAFIBACKLOG__Kanban();
|
|
|
|
#if DEBUG
|
|
[Ignore]
|
|
#endif
|
|
[TestMethod]
|
|
public void Development__v2_59_0__MESAFIBACKLOG__Kanban638323658386612552__Normal()
|
|
{
|
|
string check = "*.json";
|
|
bool validatePDSF = false;
|
|
MethodBase methodBase = new StackFrame().GetMethod();
|
|
_MESAFIBACKLOG.Development__v2_59_0__MESAFIBACKLOG__Kanban();
|
|
Assert.IsFalse(string.IsNullOrEmpty(_MESAFIBACKLOG.AdaptationTesting.TestContext.FullyQualifiedTestClassName));
|
|
string[] variables = _MESAFIBACKLOG.AdaptationTesting.GetVariables(methodBase, check, validatePDSF);
|
|
IFileRead fileRead = _MESAFIBACKLOG.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResult = fileRead.ReExtract();
|
|
Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1));
|
|
Assert.IsNotNull(extractResult.Item3);
|
|
Assert.IsNotNull(extractResult.Item4);
|
|
NonThrowTryCatch();
|
|
}
|
|
|
|
#if DEBUG
|
|
[Ignore]
|
|
#endif
|
|
[TestMethod]
|
|
public void Development__v2_59_0__MESAFIBACKLOG__Markdown() => _MESAFIBACKLOG.Development__v2_59_0__MESAFIBACKLOG__Markdown();
|
|
|
|
private static ReadOnlyDictionary<string, FileInfo> GetKeyValuePairs(List<FileInfo> collection)
|
|
{
|
|
Dictionary<string, FileInfo> results = [];
|
|
foreach (FileInfo fileInfo in collection)
|
|
results.Add(fileInfo.Name, fileInfo);
|
|
return new(results);
|
|
}
|
|
|
|
private static ReadOnlyCollection<Record> GetRecords(FileInfo fileInfo)
|
|
{
|
|
Record[] results;
|
|
string json = File.ReadAllText(fileInfo.FullName);
|
|
results = JsonSerializer.Deserialize<Record[]>(json);
|
|
return new(results);
|
|
}
|
|
|
|
private static void Verify122508(FileInfo fileInfo)
|
|
{
|
|
ReadOnlyCollection<Record> records = GetRecords(fileInfo);
|
|
Assert.IsNotNull(records);
|
|
// Assert.IsTrue(records.Count == 10);
|
|
// Assert.IsTrue(records.Count == 6);
|
|
}
|
|
|
|
private static void Verify122514(FileInfo fileInfo)
|
|
{
|
|
ReadOnlyCollection<Record> records = GetRecords(fileInfo);
|
|
Assert.IsNotNull(records);
|
|
// Assert.IsTrue(records.Count == 25);
|
|
// Assert.IsTrue(records.Count == 6);
|
|
}
|
|
|
|
private static void Verify126169(FileInfo fileInfo)
|
|
{
|
|
ReadOnlyCollection<Record> records = GetRecords(fileInfo);
|
|
Assert.IsNotNull(records);
|
|
// Assert.IsTrue(records.Count == 1);
|
|
// Assert.IsTrue(records.Count == 1);
|
|
}
|
|
|
|
private static void Verify123066(FileInfo fileInfo)
|
|
{
|
|
ReadOnlyCollection<Record> records = GetRecords(fileInfo);
|
|
Assert.IsNotNull(records);
|
|
// Assert.IsTrue(records.Count == 24);
|
|
// Assert.IsTrue(records.Count == 5);
|
|
}
|
|
|
|
private static void Verify123067(FileInfo fileInfo)
|
|
{
|
|
ReadOnlyCollection<Record> records = GetRecords(fileInfo);
|
|
Assert.IsNotNull(records);
|
|
// Assert.IsTrue(records.Count == 24);
|
|
// Assert.IsTrue(records.Count == 5);
|
|
}
|
|
|
|
private static void Verify122517(FileInfo fileInfo)
|
|
{
|
|
ReadOnlyCollection<Record> records = GetRecords(fileInfo);
|
|
Assert.IsNotNull(records);
|
|
// Assert.IsTrue(records.Count == 14);
|
|
// Assert.IsTrue(records.Count == 14);
|
|
}
|
|
|
|
#if DEBUG
|
|
[Ignore]
|
|
#endif
|
|
[TestMethod]
|
|
public void Development__v2_59_0__MESAFIBACKLOG__Markdown638323658386612552__Normal()
|
|
{
|
|
string check = "*.json";
|
|
bool validatePDSF = false;
|
|
MethodBase methodBase = new StackFrame().GetMethod();
|
|
_MESAFIBACKLOG.Development__v2_59_0__MESAFIBACKLOG__Markdown();
|
|
Assert.IsFalse(string.IsNullOrEmpty(_MESAFIBACKLOG.AdaptationTesting.TestContext.FullyQualifiedTestClassName));
|
|
string[] variables = _MESAFIBACKLOG.AdaptationTesting.GetVariables(methodBase, check, validatePDSF);
|
|
IFileRead fileRead = _MESAFIBACKLOG.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResult = fileRead.ReExtract();
|
|
Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1));
|
|
Assert.IsNotNull(extractResult.Item3);
|
|
Assert.IsNotNull(extractResult.Item4);
|
|
NonThrowTryCatch();
|
|
}
|
|
|
|
#if DEBUG
|
|
[Ignore]
|
|
#endif
|
|
[TestMethod]
|
|
public void Development__v2_59_0__MESAFIBACKLOG__ADO638323658386612552__Normal()
|
|
{
|
|
string check = "*.json";
|
|
bool validatePDSF = false;
|
|
MethodBase methodBase = new StackFrame().GetMethod();
|
|
_MESAFIBACKLOG.Development__v2_59_0__MESAFIBACKLOG__ADO();
|
|
Assert.IsFalse(string.IsNullOrEmpty(_MESAFIBACKLOG.AdaptationTesting.TestContext.FullyQualifiedTestClassName));
|
|
string[] variables = _MESAFIBACKLOG.AdaptationTesting.GetVariables(methodBase, check, validatePDSF);
|
|
IFileRead fileRead = _MESAFIBACKLOG.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResult = fileRead.ReExtract();
|
|
Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1));
|
|
Assert.IsNotNull(extractResult.Item3);
|
|
Assert.IsNotNull(extractResult.Item4);
|
|
NonThrowTryCatch();
|
|
}
|
|
|
|
#if DEBUG
|
|
[Ignore]
|
|
#endif
|
|
[TestMethod]
|
|
public void Development__v2_59_0__MESAFIBACKLOG__Priority638323658386612552__Normal()
|
|
{
|
|
string check = "*.json";
|
|
bool validatePDSF = false;
|
|
MethodBase methodBase = new StackFrame().GetMethod();
|
|
_MESAFIBACKLOG.Development__v2_59_0__MESAFIBACKLOG__Priority();
|
|
Assert.IsFalse(string.IsNullOrEmpty(_MESAFIBACKLOG.AdaptationTesting.TestContext.FullyQualifiedTestClassName));
|
|
string[] variables = _MESAFIBACKLOG.AdaptationTesting.GetVariables(methodBase, check, validatePDSF);
|
|
IFileRead fileRead = _MESAFIBACKLOG.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResult = fileRead.ReExtract();
|
|
Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1));
|
|
Assert.IsNotNull(extractResult.Item3);
|
|
Assert.IsNotNull(extractResult.Item4);
|
|
WeightedShortestJobFirstHub weightedShortestJobFirstHub = new();
|
|
Notification notification = new(fibonacci: null,
|
|
id: 1107438888,
|
|
inverse: null,
|
|
machineId: Environment.MachineName,
|
|
page: "effort",
|
|
remoteIpAddress: "10.95.36.87",
|
|
site: "MES",
|
|
time: 1737573418926,
|
|
username: Environment.UserName,
|
|
value: 1);
|
|
weightedShortestJobFirstHub.NotifyAll(notification);
|
|
NonThrowTryCatch();
|
|
}
|
|
|
|
#if DEBUG
|
|
[Ignore]
|
|
#endif
|
|
[TestMethod]
|
|
public void Development__v2_59_0__MESAFIBACKLOG__Markdown638779784153157286__Normal()
|
|
{
|
|
string check = "*.json";
|
|
bool validatePDSF = false;
|
|
MethodBase methodBase = new StackFrame().GetMethod();
|
|
_MESAFIBACKLOG.Development__v2_59_0__MESAFIBACKLOG__Markdown();
|
|
Assert.IsFalse(string.IsNullOrEmpty(_MESAFIBACKLOG.AdaptationTesting.TestContext.FullyQualifiedTestClassName));
|
|
string[] variables = _MESAFIBACKLOG.AdaptationTesting.GetVariables(methodBase, check, validatePDSF);
|
|
IFileRead fileRead = _MESAFIBACKLOG.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResult = fileRead.ReExtract();
|
|
Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1));
|
|
Assert.IsNotNull(extractResult.Item3);
|
|
Assert.IsNotNull(extractResult.Item4);
|
|
NonThrowTryCatch();
|
|
}
|
|
|
|
#if DEBUG
|
|
[Ignore]
|
|
#endif
|
|
[TestMethod]
|
|
public void Development__v2_59_0__MESAFIBACKLOG__Violation638779784153157287__Normal()
|
|
{
|
|
string check = "*.json";
|
|
bool validatePDSF = false;
|
|
MethodBase methodBase = new StackFrame().GetMethod();
|
|
_MESAFIBACKLOG.Development__v2_59_0__MESAFIBACKLOG__Violation();
|
|
Assert.IsFalse(string.IsNullOrEmpty(_MESAFIBACKLOG.AdaptationTesting.TestContext.FullyQualifiedTestClassName));
|
|
string[] variables = _MESAFIBACKLOG.AdaptationTesting.GetVariables(methodBase, check, validatePDSF);
|
|
IFileRead fileRead = _MESAFIBACKLOG.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false);
|
|
Tuple<string, Test[], JsonElement[], List<FileInfo>> extractResult = fileRead.ReExtract();
|
|
Assert.IsFalse(string.IsNullOrEmpty(extractResult?.Item1));
|
|
Assert.IsNotNull(extractResult.Item3);
|
|
Assert.IsNotNull(extractResult.Item4);
|
|
ReadOnlyDictionary<string, FileInfo> keyValuePairs = GetKeyValuePairs(extractResult.Item4);
|
|
Assert.IsTrue(keyValuePairs.ContainsKey("check-122508.json"));
|
|
Assert.IsTrue(keyValuePairs.ContainsKey("check-122514.json"));
|
|
Assert.IsTrue(keyValuePairs.ContainsKey("check-126169.json"));
|
|
Assert.IsTrue(keyValuePairs.ContainsKey("check-123066.json"));
|
|
Assert.IsTrue(keyValuePairs.ContainsKey("check-123067.json"));
|
|
Assert.IsTrue(keyValuePairs.ContainsKey("check-122517.json"));
|
|
Verify122508(keyValuePairs["check-122508.json"]);
|
|
Verify122514(keyValuePairs["check-122514.json"]);
|
|
Verify126169(keyValuePairs["check-126169.json"]);
|
|
Verify123066(keyValuePairs["check-123066.json"]);
|
|
Verify123067(keyValuePairs["check-123067.json"]);
|
|
Verify122517(keyValuePairs["check-122517.json"]);
|
|
NonThrowTryCatch();
|
|
}
|
|
|
|
}
|
|
#endif |