using System; using System.Collections.Generic; using System.Linq; using System.Threading; using Microsoft.VisualStudio.TestTools.UnitTesting; using Edge.Core.Parser.BinaryParser.Util; using Wayne_Pump_Dart.MessageEntity; using Wayne_Pump_Dart.MessageEntity.Incoming; using Wayne_Pump_Dart.MessageEntity.Outgoing; using Microsoft.Extensions.DependencyInjection; namespace Test_Wayne_Pump_Dart { [TestClass] public class DeviceHandlerTest { public static bool ValueEquals(IEnumerable array1, IEnumerable array2) { if (array1 == null && array2 == null) { return true; } if ((array1 == null) || (array2 == null)) { return false; } if (array1.Count() != array2.Count()) { return false; } if (array1.Equals(array2)) { return true; } else { for (int Index = 0; Index < array1.Count(); Index++) { if (!Equals(array1.ElementAt(Index), array2.ElementAt(Index))) { return false; } } } return true; } [TestMethod] public void TestMethod1() { var services = new ServiceCollection(); services.AddLogging(); Wayne_Pump_Dart.PumpGroupHandler pumpGroupHanlder = new Wayne_Pump_Dart.PumpGroupHandler( new Wayne_Pump_Dart.PumpGroupHandler.PumpGroupConfiguration() { AmountDecimalDigits = 1, PriceDecimalDigits = 2, VolumeDecimalDigits = 3, VolumeTotalizerDecimalDigits = 4, PumpConfigurations = new List() { new Wayne_Pump_Dart.PumpGroupHandler.PumpConfiguration() { PumpId = 1, PhysicalId = 5, NozzleConfigurations = new List() { new Wayne_Pump_Dart.PumpGroupHandler.NozzleConfiguration() { LogicalId = 1, PhysicalId = 1, }, new Wayne_Pump_Dart.PumpGroupHandler.NozzleConfiguration() { LogicalId = 2, PhysicalId = 2, } } }, new Wayne_Pump_Dart.PumpGroupHandler.PumpConfiguration() { PumpId = 2, PhysicalId = 6, NozzleConfigurations = new List() { new Wayne_Pump_Dart.PumpGroupHandler.NozzleConfiguration() { LogicalId = 1, PhysicalId = 1, }, new Wayne_Pump_Dart.PumpGroupHandler.NozzleConfiguration() { LogicalId = 2, PhysicalId = 2, } } } } }, services.BuildServiceProvider() ); } } }