1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- using Edge.Core.Processor.Dispatcher;
- using Microsoft.VisualStudio.TestTools.UnitTesting;
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace Edge.Core.Test
- {
- [TestClass]
- public class GenerateJsonSchemaTest
- {
- public class PumpGroupParameter
- {
- public enum PumpModelEnum
- {
- // for all cases, this type of dispenser, like totalizer, amount, price data fields and etc., has smaller value range
- Model_664 = 0,
- // for all cases, this type of dispenser, like totalizer, amount, price data fields and etc., has wider value range
- Model_886 = 1
- }
- public enum PumpAuthorizeModeEnum
- {
- /// <summary>
- /// in this mode, dispenser need get fc authorized then can start fueling.
- /// </summary>
- FC_Authorize = 0,
- /// <summary>
- /// in this mode, dispenser can start fueling without authorize from fc, so lift nozzle, fueling start.
- /// </summary>
- Pump_Self_Authorize = 1,
- }
- public class PumpParameter
- {
- public int PumpId { get; set; }
- /// <summary>
- /// setup in physical dispenser side.
- /// </summary>
- public byte Address { get; set; }
- public PumpModelEnum? PumpModel { get; set; } = PumpModelEnum.Model_664;
- public PumpAuthorizeModeEnum? PumpAuthorizeMode { get; set; } = PumpAuthorizeModeEnum.FC_Authorize;
- public int? AmountDecimalDigits { get; set; } = 2;
- public int? VolumeDecimalDigits { get; set; } = 2;
- public int? PriceDecimalDigits { get; set; } = 2;
- public int? VolumeTotalizerDecimalDigits { get; set; } = 2;
- }
- public IEnumerable<PumpParameter> PumpParameters { get; set; }
- }
- [TestMethod]
- public void TestMethod2()
- {
- var s = ObjectInstanceCreator.GetJsonSchemaString(typeof(PumpGroupParameter));
- }
- [TestMethod]
- public void TestMethod3()
- {
- var s = ObjectInstanceCreator.GetJsonSchemaString(new List<Type>() { typeof(PumpGroupParameter), typeof(string) });
- }
- }
- }
|