diff --git a/Adaptation/.editorconfig b/Adaptation/.editorconfig index d6755a0..b22ed15 100644 --- a/Adaptation/.editorconfig +++ b/Adaptation/.editorconfig @@ -122,6 +122,7 @@ dotnet_diagnostic.IDE0290.severity = none # Use primary constructor [Distance]cs dotnet_diagnostic.IDE0300.severity = none # IDE0300: Collection initialization can be simplified dotnet_diagnostic.IDE0301.severity = none #IDE0301: Collection initialization can be simplified dotnet_diagnostic.IDE0305.severity = none # IDE0305: Collection initialization can be simplified +dotnet_diagnostic.MSTEST0037.severity = error # MSTEST0037: Use proper 'Assert' methods dotnet_diagnostic.SYSLIB1045.severity = none # SYSLIB1045: diagnostics for regex source generation dotnet_naming_rule.abstract_method_should_be_pascal_case.severity = warning dotnet_naming_rule.abstract_method_should_be_pascal_case.style = pascal_case diff --git a/Adaptation/FileHandlers/Stratus/Constant.cs b/Adaptation/FileHandlers/Stratus/Constant.cs index 46064ca..2cf054f 100644 --- a/Adaptation/FileHandlers/Stratus/Constant.cs +++ b/Adaptation/FileHandlers/Stratus/Constant.cs @@ -16,7 +16,7 @@ internal class Constant public string Reference { get; } = "Reference"; public string StartedAt { get; } = "started at"; public string Thickness { get; } = "Thickness,"; - public string Destination { get; } = "Destination:"; - public string ProcessFailed { get; } = "------------- Process failed -------------"; + public string Destination { get; } = "Destination:"; + public string ProcessFailed { get; } = "------------- Process failed -------------"; } \ No newline at end of file diff --git a/Adaptation/FileHandlers/Stratus/Footer.cs b/Adaptation/FileHandlers/Stratus/Grade.cs similarity index 80% rename from Adaptation/FileHandlers/Stratus/Footer.cs rename to Adaptation/FileHandlers/Stratus/Grade.cs index 1a17c85..dfd6cb7 100644 --- a/Adaptation/FileHandlers/Stratus/Footer.cs +++ b/Adaptation/FileHandlers/Stratus/Grade.cs @@ -4,21 +4,21 @@ namespace Adaptation.FileHandlers.Stratus; #nullable enable -public class Footer +public class Grade { - public Footer(string meanThickness, string stdDev) + public Grade(string meanThickness, string stdDev) { - MeanThickness = meanThickness; + Mean = meanThickness; StdDev = stdDev; } - public string MeanThickness { get; } + public string Mean { get; } public string StdDev { get; } - internal static Footer? Get(Constant constant, ReadOnlyCollection groups) + internal static Grade? Get(Constant constant, ReadOnlyCollection groups) { - Footer? result; + Grade? result; int[] j = new int[] { 0 }; string stdDev = string.Empty; string meanThickness = string.Empty; diff --git a/Adaptation/FileHandlers/Stratus/ProcessData.cs b/Adaptation/FileHandlers/Stratus/ProcessData.cs index 6ef6f1a..e878552 100644 --- a/Adaptation/FileHandlers/Stratus/ProcessData.cs +++ b/Adaptation/FileHandlers/Stratus/ProcessData.cs @@ -73,8 +73,12 @@ public partial class ProcessData : IProcessData if (description.Test != (int)tests[i]) throw new Exception(); } + FileInfo fileInfo = new($"{logistics.ReportFullPath}.descriptions.json"); List fileReadDescriptions = (from l in descriptions select (Description)l).ToList(); string json = JsonSerializer.Serialize(fileReadDescriptions, fileReadDescriptions.GetType()); + File.WriteAllText(fileInfo.FullName, json); + File.SetLastWriteTime(fileInfo.FullName, logistics.DateTimeFromSequence); + fileInfoCollection.Add(fileInfo); JsonElement[] jsonElements = JsonSerializer.Deserialize(json) ?? throw new Exception(); results = new Tuple>(logistics.Logistics1[0], tests.ToArray(), jsonElements, fileInfoCollection); return results; diff --git a/Adaptation/FileHandlers/Stratus/Row.cs b/Adaptation/FileHandlers/Stratus/Row.cs index 099f9e3..12c2423 100644 --- a/Adaptation/FileHandlers/Stratus/Row.cs +++ b/Adaptation/FileHandlers/Stratus/Row.cs @@ -23,11 +23,11 @@ internal class Row Site = run.Wafers[i].Sites[j]; Slot = run.Wafers[i].Slot; Source = run.Wafers[i].Source; - WaferStdDev = run.Wafers[i].StdDev; + StdDev = run.Wafers[i].StdDev; Text = run.Wafers[i].Text; // - MeanThickness = run.Footer.MeanThickness; - StdDev = run.Footer.StdDev; + GradeMean = run.Grade.Mean; + GradeStdDev = run.Grade.StdDev; } public int Index { get; } @@ -44,16 +44,16 @@ internal class Row public string Site { get; } public string Slot { get; } public string Source { get; } - public string WaferStdDev { get; } + public string StdDev { get; } public string Text { get; } // - public string MeanThickness { get; } - public string StdDev { get; } + public string GradeMean { get; } + public string GradeStdDev { get; } } [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(Row))] -internal partial class RowSourceGenerationContext : JsonSerializerContext +internal partial class StratusRowSourceGenerationContext : JsonSerializerContext { } \ No newline at end of file diff --git a/Adaptation/FileHandlers/Stratus/Run.cs b/Adaptation/FileHandlers/Stratus/Run.cs index 7b4e4b0..764e618 100644 --- a/Adaptation/FileHandlers/Stratus/Run.cs +++ b/Adaptation/FileHandlers/Stratus/Run.cs @@ -1,5 +1,4 @@ using Adaptation.Shared; -using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; @@ -14,21 +13,21 @@ namespace Adaptation.FileHandlers.Stratus; internal class Run { - public Run(Header header, ReadOnlyCollection wafers, Footer footer) + public Run(Header header, ReadOnlyCollection wafers, Grade grade) { Header = header; Wafers = wafers; - Footer = footer; + Grade = grade; } public Header Header { get; } public ReadOnlyCollection Wafers { get; } - public Footer Footer { get; } + public Grade Grade { get; } - private static void WriteJson(Logistics logistics, List fileInfoCollection, Run? result) + private static void WriteJson(Logistics logistics, List fileInfoCollection, Run result) { - FileInfo fileInfo = new($"{logistics.ReportFullPath}.json"); - string json = JsonSerializer.Serialize(result, RunSourceGenerationContext.Default.Run); + FileInfo fileInfo = new($"{logistics.ReportFullPath}.run.json"); + string json = JsonSerializer.Serialize(result, StratusRunSourceGenerationContext.Default.Run); File.WriteAllText(fileInfo.FullName, json); File.SetLastWriteTime(fileInfo.FullName, logistics.DateTimeFromSequence); fileInfoCollection.Add(fileInfo); @@ -75,27 +74,6 @@ internal class Run return results.AsReadOnly(); } - private static void WriteCommaSeparatedValues(Logistics logistics, Run run) - { - List results = new(); - Row row; - int index = 0; - for (int i = 0; i < run.Wafers.Count; i++) - { - for (int j = 0; j < run.Wafers[i].Sites.Count; j++) - { - row = new(run, index, i, j); - results.Add(row); - index +=1; - } - } - string json = JsonSerializer.Serialize(results); - JsonElement[]? jsonElements = JsonSerializer.Deserialize(json); - ReadOnlyCollection lines = GetLines(logistics, jsonElements); - File.WriteAllText($"{logistics.ReportFullPath}.a.csv", string.Join(Environment.NewLine, lines)); - File.WriteAllText($"{logistics.ReportFullPath}.b.csv", string.Join(Environment.NewLine, lines)); - } - internal static Run? Get(Logistics logistics, List fileInfoCollection) { Run? result; @@ -117,14 +95,13 @@ internal class Run result = null; else { - Footer? footer = Footer.Get(constant, groups); - if (footer is null) + Grade? grade = Grade.Get(constant, groups); + if (grade is null) result = null; else { - result = new(header, wafers, footer); + result = new(header, wafers, grade); WriteJson(logistics, fileInfoCollection, result); - WriteCommaSeparatedValues(logistics, result); } } } @@ -136,6 +113,6 @@ internal class Run [JsonSourceGenerationOptions(WriteIndented = true)] [JsonSerializable(typeof(Run))] -internal partial class RunSourceGenerationContext : JsonSerializerContext +internal partial class StratusRunSourceGenerationContext : JsonSerializerContext { } \ No newline at end of file diff --git a/Adaptation/FileHandlers/txt/Constant.cs b/Adaptation/FileHandlers/txt/Constant.cs new file mode 100644 index 0000000..d2e3411 --- /dev/null +++ b/Adaptation/FileHandlers/txt/Constant.cs @@ -0,0 +1,23 @@ +namespace Adaptation.FileHandlers.txt; + +internal class Constant +{ + + public string Mean { get; } = "Mean"; + public string Slot { get; } = "Slot"; + public string STDD { get; } = "STDD"; + public string Batch { get; } = "Batch"; + public string Wafer { get; } = "Wafer"; + public string OneHypen { get; } = "1 - "; + public string Recipe { get; } = "Recipe"; + public string Source { get; } = "Source:"; + public string Started { get; } = "started"; + public string Cassette { get; } = "Cassette"; + public string Finished { get; } = "finished."; + public string Reference { get; } = "Reference"; + public string StartedAt { get; } = "started at"; + public string Thickness { get; } = "Thickness,"; + public string Destination { get; } = "Destination:"; + public string ProcessFailed { get; } = "------------- Process failed -------------"; + +} \ No newline at end of file diff --git a/Adaptation/FileHandlers/txt/FileRead.cs b/Adaptation/FileHandlers/txt/FileRead.cs index d412574..0a21509 100644 --- a/Adaptation/FileHandlers/txt/FileRead.cs +++ b/Adaptation/FileHandlers/txt/FileRead.cs @@ -5,6 +5,7 @@ using Adaptation.Shared.Duplicator; using Adaptation.Shared.Methods; using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.IO; using System.Text.Json; @@ -98,11 +99,13 @@ public class FileRead : Shared.FileRead, IFileRead return results; } +#nullable enable + private Tuple> GetExtractResult(string reportFullPath, DateTime dateTime) { if (dateTime == DateTime.MinValue) throw new ArgumentNullException(nameof(dateTime)); - Tuple> results = new(string.Empty, null, null, new List()); + Tuple> results = new(string.Empty, Array.Empty(), Array.Empty(), new List()); _TickOffset ??= 0; // new FileInfo(reportFullPath).LastWriteTime.Ticks - dateTime.Ticks; _Logistics = new Logistics(this, _TickOffset.Value, reportFullPath, useSplitForMID: true); SetFileParameterLotID(_Logistics.MID); @@ -111,13 +114,23 @@ public class FileRead : Shared.FileRead, IFileRead results.Item4.Add(fileInfo); else { + try + { + ReadOnlyCollection? runs = Run.Get(_TickOffset.Value, _Logistics); + // if (run is null) + // throw new Exception(string.Concat("A) No Data - ", dateTime.Ticks)); + if (runs.Count == 0) + { } + } + catch (Exception) + { } bool isBioRad; string dataText; string cassetteID; string fileNameTemp; string tupleFileName; DateTime cassetteDateTime; - string directoryName = Path.GetDirectoryName(reportFullPath); + string directoryName = Path.GetDirectoryName(reportFullPath) ?? throw new Exception(); string sequenceDirectoryName = Path.Combine(directoryName, _Logistics.Sequence.ToString()); string originalDataBioRad = Path.Combine(directoryName, $"{_OriginalDataBioRad}{_Logistics.Sequence}.txt"); IProcessData iProcessData = new ProcessData(this, _Logistics, _TickOffset.Value, results.Item4, _OriginalDataBioRad); diff --git a/Adaptation/FileHandlers/txt/Grade.cs b/Adaptation/FileHandlers/txt/Grade.cs new file mode 100644 index 0000000..ec64f9c --- /dev/null +++ b/Adaptation/FileHandlers/txt/Grade.cs @@ -0,0 +1,45 @@ +using System.Collections.ObjectModel; + +namespace Adaptation.FileHandlers.txt; + +#nullable enable + +public class Grade +{ + + public Grade(string mean, string stdDev) + { + Mean = mean; + StdDev = stdDev; + } + + public string Mean { get; } + public string StdDev { get; } + + internal static Grade? Get(Constant constant, ReadOnlyCollection groups) + { + Grade? result; + string? mean = null; + string? stdDev = null; + int[] j = new int[] { 0 }; + foreach (string groupText in groups) + { + if (!groupText.Trim().StartsWith(constant.Cassette) || !groupText.Contains(constant.Finished)) + continue; + mean = string.Empty; + stdDev = string.Empty; + Header.ScanPast(groupText, j, constant.Mean); + mean = Wafer.GetToken(groupText, j); + if (mean.EndsWith(",")) + mean = mean.Remove(mean.Length - 1, 1); + Header.ScanPast(groupText, j, constant.STDD); + stdDev = Wafer.GetToken(groupText, j); + if (stdDev.EndsWith(",")) + stdDev = stdDev.Remove(stdDev.Length - 1, 1); + } + result = mean is null || stdDev is null ? null : new(mean: mean, + stdDev: stdDev); + return result; + } + +} \ No newline at end of file diff --git a/Adaptation/FileHandlers/txt/Header.cs b/Adaptation/FileHandlers/txt/Header.cs new file mode 100644 index 0000000..50411eb --- /dev/null +++ b/Adaptation/FileHandlers/txt/Header.cs @@ -0,0 +1,96 @@ +using System; + +namespace Adaptation.FileHandlers.txt; + +#nullable enable + +public class Header +{ + + public Header(string batch, string cassette, string dateTime) + { + Batch = batch; + Cassette = cassette; + DateTime = dateTime; + } + + public string Batch { get; } + public string Cassette { get; } + public string DateTime { get; } + + internal static string GetBefore(string text, int[] i, string search) + { + string str; + string str1; + int num = text.IndexOf(search, i[0]); + if (num <= -1) + { + str = text.Substring(i[0]); + i[0] = text.Length; + str1 = str.Trim(); + } + else + { + str = text.Substring(i[0], num - i[0]); + i[0] = num + search.Length; + str1 = str.Trim(); + } + return str1; + } + + internal static string GetToEOL(string text, int[] i) + { + string result; + if (text.IndexOf("\n", i[0]) > -1) + result = GetBefore(text, i, "\n"); + else + result = GetBefore(text, i, Environment.NewLine); + return result; + } + + private static string GetToText(string text, int[] i, string search) => + text.Substring(i[0], text.IndexOf(search, i[0]) - i[0]).Trim(); + + internal static void ScanPast(string text, int[] i, string search) + { + int num = text.IndexOf(search, i[0]); + if (num <= -1) + i[0] = text.Length; + else + i[0] = num + search.Length; + } + + internal static Header Get(string text, Constant constant, int[] i) + { + Header? result; + string batch; + if (!text.Contains(constant.Batch) || !text.Contains(constant.Started)) + batch = string.Empty; + else + { + for (int z = 0; z < int.MaxValue; z++) + { + ScanPast(text, i, constant.Batch); + if (!text.Substring(i[0]).Contains(constant.Batch)) + break; + } + batch = GetToText(text, i, constant.Started); + ScanPast(text, i, constant.StartedAt); + } + ScanPast(text, i, constant.Cassette); + string cassette; + if (!text.Substring(i[0]).Contains(constant.Started)) + cassette = string.Empty; + else + cassette = GetToText(text, i, constant.Started); + ScanPast(text, i, constant.StartedAt); + string dateTime = GetToEOL(text, i); + if (dateTime.EndsWith(".")) + dateTime = dateTime.Remove(dateTime.Length - 1, 1); + result = new(batch: batch, + cassette: cassette, + dateTime: dateTime); + return result; + } + +} \ No newline at end of file diff --git a/Adaptation/FileHandlers/txt/ProcessData.cs b/Adaptation/FileHandlers/txt/ProcessData.cs index 6f483ea..54ff85b 100644 --- a/Adaptation/FileHandlers/txt/ProcessData.cs +++ b/Adaptation/FileHandlers/txt/ProcessData.cs @@ -23,10 +23,9 @@ public partial class ProcessData : IProcessData List Shared.Properties.IProcessData.Details => _Details; - public ProcessData(IFileRead fileRead, Logistics logistics, long tickOffset, List fileInfoCollection, string originalDataBioRad) + internal ProcessData(IFileRead fileRead, Logistics logistics, long tickOffset, List fileInfoCollection, string originalDataBioRad) { JobID = logistics.JobID; - fileInfoCollection.Clear(); _Details = new List(); MesEntity = logistics.MesEntity; _Log = LogManager.GetLogger(typeof(ProcessData)); @@ -52,9 +51,13 @@ public partial class ProcessData : IProcessData if (description.Test != (int)tests[i]) throw new Exception(); } + FileInfo fileInfo = new($"{logistics.ReportFullPath}.descriptions.json"); List fileReadDescriptions = (from l in descriptions select (Description)l).ToList(); string json = JsonSerializer.Serialize(fileReadDescriptions, fileReadDescriptions.GetType()); - JsonElement[] jsonElements = JsonSerializer.Deserialize(json); + File.WriteAllText(fileInfo.FullName, json); + File.SetLastWriteTime(fileInfo.FullName, logistics.DateTimeFromSequence); + fileInfoCollection.Add(fileInfo); + JsonElement[] jsonElements = JsonSerializer.Deserialize(json) ?? throw new Exception(); results = new Tuple>(logistics.Logistics1[0], tests.ToArray(), jsonElements, fileInfoCollection); return results; } diff --git a/Adaptation/FileHandlers/txt/Row.cs b/Adaptation/FileHandlers/txt/Row.cs new file mode 100644 index 0000000..0412c32 --- /dev/null +++ b/Adaptation/FileHandlers/txt/Row.cs @@ -0,0 +1,59 @@ +using System.Text.Json.Serialization; + +namespace Adaptation.FileHandlers.txt; + +#nullable enable + +internal class Row +{ + + public Row(Run run, int index, int i, int j) + { + Index = index; + // + Batch = run.Header.Batch; + Cassette = run.Header.Cassette; + DateTime = run.Header.DateTime; + // + Destination = run.Wafers[i].Destination; + Mean = run.Wafers[i].Mean; + PassFail = run.Wafers[i].PassFail; + Recipe = run.Wafers[i].Recipe; + Reference = run.Wafers[i].Reference; + Site = run.Wafers[i].Sites[j]; + Slot = run.Wafers[i].Slot; + Source = run.Wafers[i].Source; + StdDev = run.Wafers[i].StdDev; + Text = run.Wafers[i].Text; + // + GradeMean = run.Grade.Mean; + GradeStdDev = run.Grade.StdDev; + } + + public int Index { get; } + // + public string Batch { get; } + public string Cassette { get; } + public string DateTime { get; } + // + public string Destination { get; } + public string Mean { get; } + public string PassFail { get; } + public string Recipe { get; } + public string Reference { get; } + public string Site { get; } + public string Slot { get; } + public string Source { get; } + public string StdDev { get; } + public string Text { get; } + // + public string GradeMean { get; } + public string GradeStdDev { get; } + +} + +[JsonSourceGenerationOptions(WriteIndented = true)] +[JsonSerializable(typeof(Row))] +internal partial class RowSourceGenerationContext : JsonSerializerContext +{ +} \ No newline at end of file diff --git a/Adaptation/FileHandlers/txt/Run.cs b/Adaptation/FileHandlers/txt/Run.cs new file mode 100644 index 0000000..180ef7b --- /dev/null +++ b/Adaptation/FileHandlers/txt/Run.cs @@ -0,0 +1,164 @@ +using Adaptation.Shared; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace Adaptation.FileHandlers.txt; + +#nullable enable + +internal class Run +{ + + public Run(Header header, ReadOnlyCollection wafers, Grade grade) + { + Header = header; + Wafers = wafers; + Grade = grade; + } + + public Header Header { get; } + public ReadOnlyCollection Wafers { get; } + public Grade Grade { get; } + + private static ReadOnlyCollection GetLines(Logistics logistics, JsonElement[]? jsonElements) + { + List results = new(); + int columns = 0; + StringBuilder stringBuilder = new(); + results.Add($"\"Count\",{jsonElements?.Length}"); + results.Add($"\"{nameof(logistics.Sequence)}\",\"{logistics.Sequence}\""); + results.Add($"\"{nameof(logistics.MesEntity)}\",\"{logistics.MesEntity}\""); + string dateTimeFromSequence = logistics.DateTimeFromSequence.ToString("MM/dd/yyyy hh:mm:ss tt"); + for (int i = 0; i < jsonElements?.Length;) + { + _ = stringBuilder.Append('"').Append(nameof(logistics.DateTimeFromSequence)).Append('"').Append(','); + foreach (JsonProperty jsonProperty in jsonElements[0].EnumerateObject()) + { + columns += 1; + _ = stringBuilder.Append('"').Append(jsonProperty.Name).Append('"').Append(','); + } + break; + } + if (jsonElements?.Length != 0) + _ = stringBuilder.Remove(stringBuilder.Length - 1, 1); + results.Add(stringBuilder.ToString()); + for (int i = 0; i < jsonElements?.Length; i++) + { + _ = stringBuilder.Clear(); + _ = stringBuilder.Append('"').Append(dateTimeFromSequence).Append('"').Append(','); + foreach (JsonProperty jsonProperty in jsonElements[i].EnumerateObject()) + { + if (jsonProperty.Value.ValueKind == JsonValueKind.Object) + _ = stringBuilder.Append(','); + else if (jsonProperty.Value.ValueKind != JsonValueKind.String) + _ = stringBuilder.Append(jsonProperty.Value).Append(','); + else + _ = stringBuilder.Append('"').Append(jsonProperty.Value).Append('"').Append(','); + } + _ = stringBuilder.Remove(stringBuilder.Length - 1, 1); + results.Add(stringBuilder.ToString()); + } + return results.AsReadOnly(); + } + + private static void WriteCommaSeparatedValues(Logistics logistics, Run run) + { + List results = new(); + Row row; + int index = 0; + for (int i = 0; i < run.Wafers.Count; i++) + { + for (int j = 0; j < run.Wafers[i].Sites.Count; j++) + { + row = new(run, index, i, j); + results.Add(row); + index += 1; + } + } + string json = JsonSerializer.Serialize(results); + JsonElement[]? jsonElements = JsonSerializer.Deserialize(json); + ReadOnlyCollection lines = GetLines(logistics, jsonElements); + File.WriteAllText($"{logistics.ReportFullPath}_{logistics.DateTimeFromSequence.Ticks}.csv", string.Join(Environment.NewLine, lines)); + } + + private static ReadOnlyCollection GetRuns(Constant constant, string text) + { + List results = new(); + string check; + List collection = new(); + List lines = text.Split(new string[] { Environment.NewLine }, StringSplitOptions.None).ToList(); + lines.Add($"{constant.Batch}{constant.Started}"); + foreach (string line in lines) + { + if (line.StartsWith(constant.Batch) && line.Contains(constant.Started)) + { + check = string.Join(Environment.NewLine, collection); + if (check.Contains(constant.Finished)) + results.Add(check); + collection.Clear(); + } + collection.Add(line); + } + return results.AsReadOnly(); + } + + private static ReadOnlyCollection GetRuns(Logistics logistics) + { + List results = new(); + Constant constant = new(); + int[] i = new int[] { 0 }; + string allText = File.ReadAllText(logistics.ReportFullPath); + string[] segments = allText.Split(new string[] { constant.Finished }, StringSplitOptions.None); + if (segments.Length > 1) + { + Run run; + ReadOnlyCollection runs = GetRuns(constant, allText); + foreach (string text in runs) + { + Header? header = Header.Get(text, constant, i); + if (header is not null) + { + ReadOnlyCollection groups = Wafer.GetGroups(text, constant, i); + if (groups.Count > 0) + { + ReadOnlyCollection wafers = Wafer.Get(constant, groups); + if (wafers.Count > 0) + { + Grade? grade = Grade.Get(constant, groups); + if (grade is not null) + { + run = new(header, wafers, grade); + results.Add(run); + } + } + } + } + } + } + return results.AsReadOnly(); + } + + internal static ReadOnlyCollection Get(long tickOffset, Logistics logistics) + { + ReadOnlyCollection results = GetRuns(logistics); + DateTime afterCheck = new(File.GetLastWriteTime(logistics.ReportFullPath).Ticks + tickOffset); + if (logistics.DateTimeFromSequence != afterCheck) + results = new(new List()); + foreach (Run run in results) + WriteCommaSeparatedValues(logistics, run); + return results; + } + +} + +[JsonSourceGenerationOptions(WriteIndented = true)] +[JsonSerializable(typeof(Run))] +internal partial class RunSourceGenerationContext : JsonSerializerContext +{ +} \ No newline at end of file diff --git a/Adaptation/FileHandlers/txt/Wafer.cs b/Adaptation/FileHandlers/txt/Wafer.cs new file mode 100644 index 0000000..e020987 --- /dev/null +++ b/Adaptation/FileHandlers/txt/Wafer.cs @@ -0,0 +1,229 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; + +namespace Adaptation.FileHandlers.txt; + +#nullable enable + +public class Wafer +{ + + public Wafer(string destination, string mean, string passFail, string recipe, string reference, ReadOnlyCollection sites, string slot, string source, string stdDev, string waferText) + { + Destination = destination; + Mean = mean; + PassFail = passFail; + Recipe = recipe; + Reference = reference; + Sites = sites; + Slot = slot; + Source = source; + StdDev = stdDev; + Text = waferText; + } + + public string Destination { get; } + public string Mean { get; } + public string PassFail { get; } + public string Recipe { get; } + public string Reference { get; } + public ReadOnlyCollection Sites { get; } + public string Slot { get; } + public string Source { get; } + public string StdDev { get; } + public string Text { get; } + + internal static string GetToken(string text, int[] i) + { + while (true) + { + if (i[0] >= text.Length || !IsNullOrWhiteSpace(text.Substring(i[0], 1))) + break; + i[0]++; + } + int num = i[0]; + while (true) + { + if (num >= text.Length || IsNullOrWhiteSpace(text.Substring(num, 1))) + break; + num++; + } + string str = text.Substring(i[0], num - i[0]); + i[0] = num; + return str.Trim(); + } + + internal static bool IsNullOrWhiteSpace(string search) + { + bool flag; + int num = 0; + while (true) + { + if (num >= search.Length) + { + flag = true; + break; + } + else if (char.IsWhiteSpace(search[num])) + num++; + else + { + flag = false; + break; + } + } + return flag; + } + + internal static string PeekNextLine(string text, int[] i) + { + int num = i[0]; + string toEOL = Header.GetToEOL(text, i); + i[0] = num; + return toEOL; + } + + internal static ReadOnlyCollection GetGroups(string text, Constant constant, int[] i) + { + List results = new(); + string[] lines = text.Substring(i[0]).Split(new string[] { Environment.NewLine }, StringSplitOptions.None); + if (lines.Length > 0) + { + List group = new(); + foreach (string line in lines) + { + group.Add(line); + if (!line.StartsWith(constant.Destination)) + continue; + results.Add(string.Join(Environment.NewLine, group)); + group.Clear(); + } + results.Add(string.Join(Environment.NewLine, group)); + } + return results.AsReadOnly(); + } + + internal static ReadOnlyCollection Get(Constant constant, ReadOnlyCollection groups) + { + List results = new(); + string mean; + string slot; + Wafer wafer; + string recipe; + string source; + string stdDev; + string nextLine; + string passFail; + string reference; + string thickness; + string waferText; + string destination; + List sites; + int[] j = new int[] { 0 }; + foreach (string groupText in groups) + { + j[0] = 0; + sites = new(); + if (groupText.Contains(constant.ProcessFailed)) + { + mean = string.Empty; + slot = string.Empty; + recipe = string.Empty; + source = string.Empty; + stdDev = string.Empty; + passFail = string.Empty; + reference = string.Empty; + waferText = string.Empty; + destination = string.Empty; + } + else if (groupText.Contains(constant.Reference)) + { + mean = string.Empty; + slot = string.Empty; + recipe = string.Empty; + stdDev = string.Empty; + passFail = string.Empty; + waferText = string.Empty; + Header.ScanPast(groupText, j, constant.Reference); + reference = Header.GetToEOL(groupText, j); + Header.ScanPast(groupText, j, constant.Source); + source = Header.GetToEOL(groupText, j).Trim(); + Header.ScanPast(groupText, j, constant.Destination); + destination = Header.GetToEOL(groupText, j).Trim(); + } + else + { + if (!groupText.Contains(constant.Wafer)) + continue; + Header.ScanPast(groupText, j, constant.Wafer); + waferText = Header.GetToEOL(groupText, j); + if (waferText.EndsWith(".")) + waferText = waferText.Remove(waferText.Length - 1, 1); + Header.ScanPast(groupText, j, constant.Slot); + slot = Header.GetToEOL(groupText, j); + Header.ScanPast(groupText, j, constant.Recipe); + recipe = Header.GetToEOL(groupText, j); + if (recipe.EndsWith(".")) + recipe = recipe.Remove(recipe.Length - 1, 1); + Header.ScanPast(groupText, j, constant.Thickness); + _ = GetToken(groupText, j); + nextLine = PeekNextLine(groupText, j); + if (nextLine.Contains(constant.OneHypen)) + { + Header.ScanPast(groupText, j, constant.OneHypen); + _ = GetToken(groupText, j); + } + for (int k = 0; k < 100; k++) + { + nextLine = PeekNextLine(groupText, j); + if (nextLine.Contains("Slot")) + break; + if (string.IsNullOrEmpty(nextLine)) + { + _ = Header.GetToEOL(groupText, j); + continue; + } + thickness = GetToken(groupText, j); + if (thickness == constant.Thickness) + { + _ = GetToken(groupText, j); + continue; + } + sites.Add(thickness); + } + Header.ScanPast(groupText, j, constant.Slot); + _ = GetToken(groupText, j); + passFail = GetToken(groupText, j); + if (passFail.EndsWith(".")) + passFail = passFail.Remove(passFail.Length - 1, 1); + Header.ScanPast(groupText, j, constant.Mean); + mean = GetToken(groupText, j); + if (mean.EndsWith(",")) + mean = mean.Remove(mean.Length - 1, 1); + Header.ScanPast(groupText, j, constant.STDD); + stdDev = Header.GetToEOL(groupText, j); + if (stdDev.EndsWith(".")) + stdDev = stdDev.Remove(stdDev.Length - 1, 1); + reference = string.Empty; + Header.ScanPast(groupText, j, constant.Source); + source = Header.GetToEOL(groupText, j).Trim(); + Header.ScanPast(groupText, j, constant.Destination); + destination = Header.GetToEOL(groupText, j).Trim(); + } + wafer = new(destination: destination, + mean: mean, + passFail: passFail, + recipe: recipe, + reference: reference, + sites: sites.AsReadOnly(), + slot: slot, + source: source, + stdDev: stdDev, + waferText: waferText); + results.Add(wafer); + } + return results.AsReadOnly(); + } + +} \ No newline at end of file diff --git a/Adaptation/MET08THFTIRSTRATUS.Tests.csproj b/Adaptation/MET08THFTIRSTRATUS.Tests.csproj index a6de62b..b62fa5d 100644 --- a/Adaptation/MET08THFTIRSTRATUS.Tests.csproj +++ b/Adaptation/MET08THFTIRSTRATUS.Tests.csproj @@ -69,7 +69,7 @@ - NU1701 + NU1701 diff --git a/Adaptation/Shared/FileRead.cs b/Adaptation/Shared/FileRead.cs index 2c3fd06..bc160cf 100644 --- a/Adaptation/Shared/FileRead.cs +++ b/Adaptation/Shared/FileRead.cs @@ -491,7 +491,7 @@ public class FileRead : Properties.IFileRead protected static void NestExistingFiles(FileConnectorConfiguration fileConnectorConfiguration) { - if (!fileConnectorConfiguration.IncludeSubDirectories.Value) + if (!fileConnectorConfiguration.IncludeSubDirectories.Value && fileConnectorConfiguration.TriggerOnCreated is not null && fileConnectorConfiguration.TriggerOnCreated.Value) { string[] matches = GetMatches(fileConnectorConfiguration); if (matches is not null && matches.Length > 0) diff --git a/Adaptation/Shared/ProcessDataStandardFormat.cs b/Adaptation/Shared/ProcessDataStandardFormat.cs index 136ccae..b2ca7b6 100644 --- a/Adaptation/Shared/ProcessDataStandardFormat.cs +++ b/Adaptation/Shared/ProcessDataStandardFormat.cs @@ -152,9 +152,11 @@ public class ProcessDataStandardFormat { string value; string[] segments; + List lines = new(); StringBuilder stringBuilder = new(); foreach (string bodyLine in bodyLines) { + _ = stringBuilder.Clear(); _ = stringBuilder.Append('{'); segments = bodyLine.Trim().Split('\t'); if (!lookForNumbers) @@ -179,10 +181,11 @@ public class ProcessDataStandardFormat } } _ = stringBuilder.Remove(stringBuilder.Length - 1, 1); - _ = stringBuilder.AppendLine("},"); + _ = stringBuilder.AppendLine("}"); + lines.Add(stringBuilder.ToString()); } - _ = stringBuilder.Remove(stringBuilder.Length - 3, 3); - results = JsonSerializer.Deserialize(string.Concat("[", stringBuilder, "]")); + string json = $"[{string.Join(",", lines)}]"; + results = JsonSerializer.Deserialize(json); } return results; } diff --git a/Adaptation/_Tests/Extract/Production/v2.59.0/BIORAD4.cs b/Adaptation/_Tests/Extract/Production/v2.59.0/BIORAD4.cs index 8bd1c64..93925b3 100644 --- a/Adaptation/_Tests/Extract/Production/v2.59.0/BIORAD4.cs +++ b/Adaptation/_Tests/Extract/Production/v2.59.0/BIORAD4.cs @@ -30,6 +30,22 @@ public class BIORAD4 [TestMethod] public void Production__v2_59_0__BIORAD4__txt() => _BIORAD4.Production__v2_59_0__BIORAD4__txt(); +#if ALWAYS + [Ignore] +#endif + [TestMethod] + public void Production__v2_59_0__BIORAD4__txt638763379187800166__Partial() + { + bool validatePDSF = false; + string check = "*DataBioRad.txt"; + _BIORAD4.Production__v2_59_0__BIORAD4__txt(); + MethodBase methodBase = new StackFrame().GetMethod(); + string[] variables = _BIORAD4.AdaptationTesting.GetVariables(methodBase, check, validatePDSF); + IFileRead fileRead = _BIORAD4.AdaptationTesting.Get(methodBase, sourceFileLocation: variables[2], sourceFileFilter: variables[3], useCyclicalForDescription: false); + _ = fileRead.ReExtract(); + Shared.AdaptationTesting.UpdatePassDirectory(variables[2]); + } + #if DEBUG [Ignore] #endif @@ -148,9 +164,9 @@ public class BIORAD4 Logistics logistics = new(fileRead); _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics, validatePDSF); dateTime = FileHandlers.Stratus.ProcessData.GetDateTime(logistics, string.Empty); - Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + Assert.AreEqual(logistics.DateTimeFromSequence, dateTime); dateTime = FileHandlers.Stratus.ProcessData.GetDateTime(logistics, "11/24/21 08:39"); - Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + Assert.AreEqual(logistics.DateTimeFromSequence, dateTime); } #if DEBUG diff --git a/Adaptation/_Tests/Extract/Production/v2.59.0/BIORAD5.cs b/Adaptation/_Tests/Extract/Production/v2.59.0/BIORAD5.cs index 4b414d3..7f52e30 100644 --- a/Adaptation/_Tests/Extract/Production/v2.59.0/BIORAD5.cs +++ b/Adaptation/_Tests/Extract/Production/v2.59.0/BIORAD5.cs @@ -76,9 +76,9 @@ public class BIORAD5 Logistics logistics = new(fileRead); _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics, validatePDSF); dateTime = FileHandlers.Stratus.ProcessData.GetDateTime(logistics, string.Empty); - Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + Assert.AreEqual(logistics.DateTimeFromSequence, dateTime); dateTime = FileHandlers.Stratus.ProcessData.GetDateTime(logistics, "11/24/21 08:39"); - Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + Assert.AreEqual(logistics.DateTimeFromSequence, dateTime); NonThrowTryCatch(); } @@ -98,9 +98,9 @@ public class BIORAD5 Logistics logistics = new(fileRead); _ = Shared.AdaptationTesting.ReExtractCompareUpdatePassDirectory(variables, fileRead, logistics, validatePDSF); dateTime = FileHandlers.Stratus.ProcessData.GetDateTime(logistics, string.Empty); - Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + Assert.AreEqual(logistics.DateTimeFromSequence, dateTime); dateTime = FileHandlers.Stratus.ProcessData.GetDateTime(logistics, "11/24/21 08:39"); - Assert.IsTrue(dateTime == logistics.DateTimeFromSequence); + Assert.AreEqual(logistics.DateTimeFromSequence, dateTime); NonThrowTryCatch(); } diff --git a/Adaptation/_Tests/Shared/AdaptationTesting.cs b/Adaptation/_Tests/Shared/AdaptationTesting.cs index 8a341d4..66cf18e 100644 --- a/Adaptation/_Tests/Shared/AdaptationTesting.cs +++ b/Adaptation/_Tests/Shared/AdaptationTesting.cs @@ -1111,7 +1111,7 @@ public class AdaptationTesting : ISMTP pdsfFiles = Directory.GetFiles(searchDirectory, searchPattern, SearchOption.TopDirectoryOnly); if (pdsfFiles.Length == 0) _ = Process.Start("explorer.exe", searchDirectory); - Assert.IsTrue(pdsfFiles.Length != 0, "GetFiles check"); + Assert.AreNotEqual(0, pdsfFiles.Length, "GetFiles check"); results = GetLogisticsColumnsAndBody(pdsfFiles[0]); } Assert.IsFalse(string.IsNullOrEmpty(results.Item1)); @@ -1259,13 +1259,13 @@ public class AdaptationTesting : ISMTP Tuple pdsf = GetLogisticsColumnsAndBody(variables[2], variables[4]); Tuple pdsfNew = GetLogisticsColumnsAndBody(fileRead, logistics, extractResult, pdsf); CompareSave(variables[5], pdsf, pdsfNew); - Assert.IsTrue(pdsf.Item1 == pdsfNew.Item1, "Item1 check!"); + Assert.AreEqual(pdsfNew.Item1, pdsf.Item1, "Item1 check!"); string[] json = GetItem2(pdsf, pdsfNew); CompareSaveJSON(variables[5], json); - Assert.IsTrue(json[0] == json[1], "Item2 check!"); + Assert.AreEqual(json[1], json[0], "Item2 check!"); string[] join = GetItem3(pdsf, pdsfNew); CompareSaveTSV(variables[5], join); - Assert.IsTrue(join[0] == join[1], "Item3 (Join) check!"); + Assert.AreEqual(join[1], join[0], "Item3 (Join) check!"); } UpdatePassDirectory(variables[2]); } diff --git a/Adaptation/_Tests/Static/MET08THFTIRSTRATUS.cs b/Adaptation/_Tests/Static/MET08THFTIRSTRATUS.cs index 46e7fb2..715a2d3 100644 --- a/Adaptation/_Tests/Static/MET08THFTIRSTRATUS.cs +++ b/Adaptation/_Tests/Static/MET08THFTIRSTRATUS.cs @@ -51,7 +51,7 @@ public class MET08THFTIRSTRATUS : LoggingUnitTesting, IDisposable public void TestDateTime() { DateTime dateTime = DateTime.Now; - Assert.IsTrue(dateTime.ToString("M/d/yyyy h:mm:ss tt") == dateTime.ToString()); + Assert.AreEqual(dateTime.ToString(), dateTime.ToString("M/d/yyyy h:mm:ss tt")); } #if DEBUG diff --git a/Adaptation/_Tests/Static/Stratus.cs b/Adaptation/_Tests/Static/Stratus.cs index 1b5e81d..d5f3de7 100644 --- a/Adaptation/_Tests/Static/Stratus.cs +++ b/Adaptation/_Tests/Static/Stratus.cs @@ -52,7 +52,7 @@ public class Stratus : LoggingUnitTesting, IDisposable public void TestDateTime() { DateTime dateTime = DateTime.Now; - Assert.IsTrue(dateTime.ToString("M/d/yyyy h:mm:ss tt") == dateTime.ToString()); + Assert.AreEqual(dateTime.ToString(), dateTime.ToString("M/d/yyyy h:mm:ss tt")); } [TestMethod] @@ -69,22 +69,22 @@ public class Stratus : LoggingUnitTesting, IDisposable Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); descriptor = ProcessData.GetDescriptor("12-123456-1234"); - Assert.IsTrue(descriptor.Reactor is "12"); - Assert.IsTrue(descriptor.RDS is "123456"); - Assert.IsTrue(descriptor.PSN is "1234"); + Assert.AreEqual("12", descriptor.Reactor); + Assert.AreEqual("123456", descriptor.RDS); + Assert.AreEqual("1234", descriptor.PSN); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); descriptor = ProcessData.GetDescriptor("123456"); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor)); - Assert.IsTrue(descriptor.RDS is "123456"); + Assert.AreEqual("123456", descriptor.RDS); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); descriptor = ProcessData.GetDescriptor("1T123456"); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor)); - Assert.IsTrue(descriptor.RDS is "123456"); + Assert.AreEqual("123456", descriptor.RDS); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); @@ -93,92 +93,92 @@ public class Stratus : LoggingUnitTesting, IDisposable Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); - Assert.IsTrue(descriptor.Employee is "MP"); + Assert.AreEqual("MP", descriptor.Employee); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); descriptor = ProcessData.GetDescriptor("12-123456-1234.2-1"); - Assert.IsTrue(descriptor.Reactor is "12"); - Assert.IsTrue(descriptor.RDS is "123456"); - Assert.IsTrue(descriptor.PSN is "1234"); - Assert.IsTrue(descriptor.Layer is "2"); - Assert.IsTrue(descriptor.Zone is "1"); + Assert.AreEqual("12", descriptor.Reactor); + Assert.AreEqual("123456", descriptor.RDS); + Assert.AreEqual("1234", descriptor.PSN); + Assert.AreEqual("2", descriptor.Layer); + Assert.AreEqual("1", descriptor.Zone); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); descriptor = ProcessData.GetDescriptor("12-123456-1234.02-1"); - Assert.IsTrue(descriptor.Reactor is "12"); - Assert.IsTrue(descriptor.RDS is "123456"); - Assert.IsTrue(descriptor.PSN is "1234"); - Assert.IsTrue(descriptor.Layer is "2"); - Assert.IsTrue(descriptor.Zone is "1"); + Assert.AreEqual("12", descriptor.Reactor); + Assert.AreEqual("123456", descriptor.RDS); + Assert.AreEqual("1234", descriptor.PSN); + Assert.AreEqual("2", descriptor.Layer); + Assert.AreEqual("1", descriptor.Zone); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); descriptor = ProcessData.GetDescriptor("20"); - Assert.IsTrue(descriptor.Reactor is "20"); + Assert.AreEqual("20", descriptor.Reactor); Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); descriptor = ProcessData.GetDescriptor("20.2"); - Assert.IsTrue(descriptor.Reactor is "20"); + Assert.AreEqual("20", descriptor.Reactor); Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); - Assert.IsTrue(descriptor.Layer is "2"); + Assert.AreEqual("2", descriptor.Layer); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); descriptor = ProcessData.GetDescriptor("20.2.1"); - Assert.IsTrue(descriptor.Layer is "2"); + Assert.AreEqual("2", descriptor.Layer); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS)); - Assert.IsTrue(descriptor.Reactor is "20"); - Assert.IsTrue(descriptor.Zone is "1"); + Assert.AreEqual("20", descriptor.Reactor); + Assert.AreEqual("1", descriptor.Zone); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); descriptor = ProcessData.GetDescriptor("20.1.1"); - Assert.IsTrue(descriptor.Layer is "1"); + Assert.AreEqual("1", descriptor.Layer); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS)); - Assert.IsTrue(descriptor.Reactor is "20"); - Assert.IsTrue(descriptor.Zone is "1"); + Assert.AreEqual("20", descriptor.Reactor); + Assert.AreEqual("1", descriptor.Zone); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); descriptor = ProcessData.GetDescriptor("P2-LOW-RR"); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); - Assert.IsTrue(descriptor.PSN is "RR"); + Assert.AreEqual("RR", descriptor.PSN); Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS)); - Assert.IsTrue(descriptor.Reactor is "P2"); + Assert.AreEqual("P2", descriptor.Reactor); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); descriptor = ProcessData.GetDescriptor("i171308.1.51"); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); - Assert.IsTrue(descriptor.RDS is "i171308.1.51"); + Assert.AreEqual("i171308.1.51", descriptor.RDS); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); descriptor = ProcessData.GetDescriptor("o171308.1.51"); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); - Assert.IsTrue(descriptor.RDS is "o171308.1.51"); + Assert.AreEqual("o171308.1.51", descriptor.RDS); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); descriptor = ProcessData.GetDescriptor("O171308.1.51"); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); - Assert.IsTrue(descriptor.RDS is "O171308.1.51"); + Assert.AreEqual("O171308.1.51", descriptor.RDS); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); descriptor = ProcessData.GetDescriptor("171308.1.51"); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.PSN)); - Assert.IsTrue(descriptor.RDS is "171308.1.51"); + Assert.AreEqual("171308.1.51", descriptor.RDS); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Reactor)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); descriptor = ProcessData.GetDescriptor("75-QP1414-SPLIT4"); - // Assert.IsTrue(!string.IsNullOrEmpty(descriptor.Lot)); + // Assert.IsFalse(string.IsNullOrEmpty(descriptor.Lot)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Layer)); - Assert.IsTrue(descriptor.PSN is "SPLIT4"); + Assert.AreEqual("SPLIT4", descriptor.PSN); Assert.IsTrue(string.IsNullOrEmpty(descriptor.RDS)); - Assert.IsTrue(descriptor.Reactor is "75"); + Assert.AreEqual("75", descriptor.Reactor); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Zone)); Assert.IsTrue(string.IsNullOrEmpty(descriptor.Employee)); descriptor = ProcessData.GetDescriptor("B48"); diff --git a/MET08THFTIRSTRATUS.csproj b/MET08THFTIRSTRATUS.csproj index e402539..e9ac514 100644 --- a/MET08THFTIRSTRATUS.csproj +++ b/MET08THFTIRSTRATUS.csproj @@ -124,15 +124,21 @@ - + + + + + + +