Tests passed using Mock

This commit is contained in:
2023-11-01 08:27:25 -07:00
parent f684c4b7ef
commit 3dd4034a84
81 changed files with 171126 additions and 139391 deletions

View File

@ -1,5 +1,6 @@
using Adaptation.FileHandlers.json;
using OI.Metrology.Shared.Models.Stateless;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Text;
using System.Text.Json;
@ -95,7 +96,7 @@ public class SpreadingResistanceProfileService : ISpreadingResistanceProfileServ
return rectangles.ToArray();
}
private static string[] GetRectanglesDescriptions(Info info, Setup setup, List<Layer> layers)
private static ReadOnlyCollection<string> GetRectanglesDescriptions(Info info, Setup setup, List<Layer> layers)
{
List<string> results = new()
{
@ -123,7 +124,7 @@ public class SpreadingResistanceProfileService : ISpreadingResistanceProfileServ
_ = stringBuilder.AppendLine(string.Concat("First Pt. ", layer.FirstPoint, " Last Pt. ", layer.LastPoint, " Type ", layer.Type, " Smoothing ", layer.Smoothing, " Correction ", layer.Correction));
_ = stringBuilder.AppendLine(string.Join(" ", info.Comments));
results[0] = stringBuilder.ToString();
return results.ToArray();
return new(results);
}
internal static byte[] GetImageBytes(CSV csv)
@ -182,8 +183,8 @@ public class SpreadingResistanceProfileService : ISpreadingResistanceProfileServ
graphics.FillRectangles(Brushes.White, rectangles);
graphics.DrawRectangles(pen, rectangles);
string[] descriptions = GetRectanglesDescriptions(csv.Info, csv.Setup, csv.LayerHeader.Layers);
for (int i = 0; i < descriptions.Length; i++)
ReadOnlyCollection<string> descriptions = GetRectanglesDescriptions(csv.Info, csv.Setup, csv.LayerHeader.Layers);
for (int i = 0; i < descriptions.Count; i++)
graphics.DrawString(descriptions[i], consolas, brush, rectangles[i]);
DrawLine(graphics, concentrationPen, 13, 6, 13, 40);