123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- 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<byte> array1, IEnumerable<byte> 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<Wayne_Pump_Dart.PumpGroupHandler.PumpConfiguration>()
- {
- new Wayne_Pump_Dart.PumpGroupHandler.PumpConfiguration()
- {
- PumpId = 1,
- PhysicalId = 5,
- NozzleConfigurations = new List<Wayne_Pump_Dart.PumpGroupHandler.NozzleConfiguration>()
- {
- 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<Wayne_Pump_Dart.PumpGroupHandler.NozzleConfiguration>()
- {
- new Wayne_Pump_Dart.PumpGroupHandler.NozzleConfiguration()
- {
- LogicalId = 1,
- PhysicalId = 1,
- },
- new Wayne_Pump_Dart.PumpGroupHandler.NozzleConfiguration()
- {
- LogicalId = 2,
- PhysicalId = 2,
- }
- }
- }
- }
- }, services.BuildServiceProvider()
- );
- }
- }
- }
|