Beispiel #1
0
        public void op_BiggerOrEqual_Bigger1_Test()
        {
            var _EVSEOperator_Id1 = ChargingStationOperator_Id.Parse(Country.Germany, "2");
            var _EVSEOperator_Id2 = ChargingStationOperator_Id.Parse(Country.Germany, "1");

            Assert.IsTrue(_EVSEOperator_Id1 >= _EVSEOperator_Id2);
        }
Beispiel #2
0
        public void op_BiggerOrEqual_SmallerThan2_Test()
        {
            var _EVSEOperator_Id1 = ChargingStationOperator_Id.Parse(Country.Germany, "5");
            var _EVSEOperator_Id2 = ChargingStationOperator_Id.Parse(Country.Germany, "23");

            Assert.IsFalse(_EVSEOperator_Id1 >= _EVSEOperator_Id2);
        }
Beispiel #3
0
        public void op_Bigger_Bigger2_Test()
        {
            var _EVSEOperator_Id1 = ChargingStationOperator_Id.Parse(Country.Germany, "23");
            var _EVSEOperator_Id2 = ChargingStationOperator_Id.Parse(Country.Germany, "5");

            Assert.IsTrue(_EVSEOperator_Id1 > _EVSEOperator_Id2);
        }
Beispiel #4
0
        public void op_Bigger_Smaller1_Test()
        {
            var _EVSEOperator_Id1 = ChargingStationOperator_Id.Parse(Country.Germany, "1");
            var _EVSEOperator_Id2 = ChargingStationOperator_Id.Parse(Country.Germany, "2");

            Assert.IsFalse(_EVSEOperator_Id1 > _EVSEOperator_Id2);
        }
Beispiel #5
0
        public void CompareToNonEVSEOperator_IdTest()
        {
            var _EVSEOperator_Id = ChargingStationOperator_Id.Parse(Country.Germany, "123");
            var _Object          = "123";

            Assert.Throws <ArgumentNullException>(() => { var x = _EVSEOperator_Id.CompareTo(_Object); });
        }
Beispiel #6
0
        public void op_Inequality_Equals_Test()
        {
            var _EVSE_Id1 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "1");
            var _EVSE_Id2 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "1");

            Assert.IsFalse(_EVSE_Id1 != _EVSE_Id2);
        }
Beispiel #7
0
        public void op_Inequality_NotEquals2_Test()
        {
            var _EVSEOperator_Id1 = ChargingStationOperator_Id.Parse(Country.Germany, "5");
            var _EVSEOperator_Id2 = ChargingStationOperator_Id.Parse(Country.Germany, "23");

            Assert.IsTrue(_EVSEOperator_Id1 != _EVSEOperator_Id2);
        }
Beispiel #8
0
        public void EqualsEqualsTest()
        {
            var _EVSEOperator_Id1 = ChargingStationOperator_Id.Parse(Country.Germany, "1");
            var _EVSEOperator_Id2 = ChargingStationOperator_Id.Parse(Country.Germany, "1");

            Assert.IsTrue(_EVSEOperator_Id1.Equals(_EVSEOperator_Id2));
        }
Beispiel #9
0
        public void EqualsNonEVSEOperator_IdTest()
        {
            var _EVSEOperator_Id = ChargingStationOperator_Id.Parse(Country.Germany, "123");
            var _Object          = "DE*123";

            Assert.IsFalse(_EVSEOperator_Id.Equals(_Object));
        }
Beispiel #10
0
        public void GetHashCodeEqualTest()
        {
            var _SensorHashCode1 = ChargingStationOperator_Id.Parse(Country.Germany, "5").GetHashCode();
            var _SensorHashCode2 = ChargingStationOperator_Id.Parse(Country.Germany, "5").GetHashCode();

            Assert.AreEqual(_SensorHashCode1, _SensorHashCode2);
        }
Beispiel #11
0
        public void CompareToEqualsTest()
        {
            var _EVSEOperator_Id1 = ChargingStationOperator_Id.Parse(Country.Germany, "1");
            var _EVSEOperator_Id2 = ChargingStationOperator_Id.Parse(Country.Germany, "1");

            Assert.IsTrue(_EVSEOperator_Id1.CompareTo(_EVSEOperator_Id2) == 0);
        }
Beispiel #12
0
        public void op_Smaller_Smaller1_Test()
        {
            var _EVSE_Id1 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "1");
            var _EVSE_Id2 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "2");

            Assert.Throws <ArgumentNullException>(() => { var x = _EVSE_Id1 < _EVSE_Id2; });
        }
Beispiel #13
0
        public void EqualsNotEqualsTest()
        {
            var _EVSE_Id1 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "1");
            var _EVSE_Id2 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "2");

            Assert.IsFalse(_EVSE_Id1.Equals(_EVSE_Id2));
        }
Beispiel #14
0
        public void CompareToBiggerTest()
        {
            var _EVSE_Id1 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "2");
            var _EVSE_Id2 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "1");

            Assert.IsTrue(_EVSE_Id1.CompareTo(_EVSE_Id2) > 0);
        }
Beispiel #15
0
        public void op_Bigger_Smaller2_Test()
        {
            var _EVSE_Id1 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "5");
            var _EVSE_Id2 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "23");

            Assert.IsFalse(_EVSE_Id1 > _EVSE_Id2);
        }
Beispiel #16
0
        public void op_BiggerOrEqual_Bigger2_Test()
        {
            var _EVSE_Id1 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "23");
            var _EVSE_Id2 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "5");

            Assert.IsTrue(_EVSE_Id1 >= _EVSE_Id2);
        }
Beispiel #17
0
        public void CompareToSmallerTest2()
        {
            var _EVSE_Id1 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "5");
            var _EVSE_Id2 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "23");

            Assert.IsTrue(_EVSE_Id1.CompareTo(_EVSE_Id2) < 0);
        }
Beispiel #18
0
        public void op_BiggerOrEqual_SmallerThan1_Test()
        {
            var _EVSE_Id1 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "1");
            var _EVSE_Id2 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "2");

            Assert.IsFalse(_EVSE_Id1 >= _EVSE_Id2);
        }
Beispiel #19
0
        public void EVSE_IdStringConstructorTest()
        {
            var _EVSE_Id = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "123");

            Assert.AreEqual("123", _EVSE_Id.ToString());
            Assert.AreEqual(3, _EVSE_Id.Length);
        }
Beispiel #20
0
        public void CompareToSmallerTest1()
        {
            var _EVSEOperator_Id1 = ChargingStationOperator_Id.Parse(Country.Germany, "1");
            var _EVSEOperator_Id2 = ChargingStationOperator_Id.Parse(Country.Germany, "2");

            Assert.IsTrue(_EVSEOperator_Id1.CompareTo(_EVSEOperator_Id2) < 0);
        }
Beispiel #21
0
        public void op_Bigger_Bigger1_Test()
        {
            var _EVSE_Id1 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "2");
            var _EVSE_Id2 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "1");

            Assert.IsTrue(_EVSE_Id1 > _EVSE_Id2);
        }
Beispiel #22
0
        public void op_SmallerOrEqual_Equals_Test()
        {
            var _EVSE_Id1 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "1");
            var _EVSE_Id2 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "1");

            Assert.IsTrue(_EVSE_Id1 <= _EVSE_Id2);
        }
Beispiel #23
0
        public void GetHashCodeNotEqualTest()
        {
            var _SensorHashCode1 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "1").GetHashCode();
            var _SensorHashCode2 = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "2").GetHashCode();

            Assert.AreNotEqual(_SensorHashCode1, _SensorHashCode2);
        }
Beispiel #24
0
        public void op_Equality_Equals_Test()
        {
            var _EVSEOperator_Id1 = ChargingStationOperator_Id.Parse(Country.Germany, "123");
            var _EVSEOperator_Id2 = ChargingStationOperator_Id.Parse(Country.Germany, "123");

            Assert.IsTrue(_EVSEOperator_Id1 == _EVSEOperator_Id2);
        }
Beispiel #25
0
        public void op_Smaller_SameReference_Test()
        {
            var _EVSEOperator_Id1 = ChargingStationOperator_Id.Parse(Country.Germany, "123");

            #pragma warning disable
            Assert.IsFalse(_EVSEOperator_Id1 < _EVSEOperator_Id1);
            #pragma warning restore
        }
Beispiel #26
0
        public void op_Equality_SameReference_Test()
        {
            var _EVSEOperator_Id1 = ChargingStationOperator_Id.Parse(Country.Germany, "123");

            #pragma warning disable
            Assert.IsTrue(_EVSEOperator_Id1 == _EVSEOperator_Id1);
            #pragma warning restore
        }
Beispiel #27
0
        public void EVSEOperator_IdEVSEOperator_IdConstructorTest()
        {
            var _EVSEOperator_Id1 = ChargingStationOperator_Id.Parse(Country.Germany, "123");
            var _EVSEOperator_Id2 = _EVSEOperator_Id1.Clone;

            Assert.AreEqual(_EVSEOperator_Id1.ToString(), _EVSEOperator_Id2.ToString());
            Assert.AreEqual(_EVSEOperator_Id1.Length, _EVSEOperator_Id2.Length);
            Assert.AreEqual(_EVSEOperator_Id1, _EVSEOperator_Id2);
        }
Beispiel #28
0
        public void Test0()
        {
            var _rn = new RoamingNetwork(RoamingNetwork_Id.Parse("Test1"));
            var _op = _rn.CreateChargingStationOperator(ChargingStationOperator_Id.Parse("DE*822"));
            var _cp = _op.CreateChargingPool();

            _cp.StatusAggregationDelegate = report => {
                var max   = report.Max(v => v.Value);
                var max_n = report.Where(o => o.Value == max);
                return((ChargingPoolStatusTypes)max_n.OrderBy(o => o.Key).First().Key);
            };
            _cp.OnStatusChanged += async(ts, EventTrackingId, pool, os, ns) => { Console.WriteLine("New pool state: " + ns.Value); };

            var s1 = _cp.CreateChargingStation(ChargingStation_Id.Random(_op.Id));

            s1.StatusAggregationDelegate = report => {
                var max   = report.Max(v => v.Value);
                var max_n = report.Where(o => o.Value == max);
                return((ChargingStationStatusTypes)max_n.OrderBy(o => o.Key).First().Key);
            };
            s1.OnStatusChanged += async(ts, EventTrackingId, sta, os, ns) => { Console.WriteLine("New station #1 state: " + ns.Value); };

            var e1 = s1.CreateEVSE(EVSE_Id.Parse("DE*822*E1111*1"));
            var e2 = s1.CreateEVSE(EVSE_Id.Parse("DE*822*E1111*2"));
            var e3 = s1.CreateEVSE(EVSE_Id.Parse("DE*822*E1111*3"));
            var s2 = _cp.CreateChargingStation(ChargingStation_Id.Random(_op.Id));

            s2.StatusAggregationDelegate = report => {
                var max   = report.Max(v => v.Value);
                var max_n = report.Where(o => o.Value == max);
                return((ChargingStationStatusTypes)max_n.OrderBy(o => o.Key).First().Key);
            };
            s2.OnStatusChanged += async(ts, EventTrackingId, sta, os, ns) => { Console.WriteLine("New station #2 state: " + ns.Value); };

            var f1 = s2.CreateEVSE(EVSE_Id.Parse("DE*822*E2222*1"));
            var f2 = s2.CreateEVSE(EVSE_Id.Parse("DE*822*E2222*2"));
            var f3 = s2.CreateEVSE(EVSE_Id.Parse("DE*822*E2222*3"));


            e1.Status = EVSEStatusTypes.Available;
            e2.Status = EVSEStatusTypes.Available;
            e3.Status = EVSEStatusTypes.Available;

            f1.Status = EVSEStatusTypes.Available;
            f2.Status = EVSEStatusTypes.Available;
            f3.Status = EVSEStatusTypes.Available;

            e2.Status = EVSEStatusTypes.Charging;
            e3.Status = EVSEStatusTypes.Charging;
        }
Beispiel #29
0
        public void EVSE_IdsAndNUnitTest()
        {
            var a = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "1");
            var b = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "2");
            var c = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "1");

            Assert.AreEqual(a, a);
            Assert.AreEqual(b, b);
            Assert.AreEqual(c, c);

            Assert.AreEqual(a, c);
            Assert.AreNotEqual(a, b);
            Assert.AreNotEqual(b, c);
        }
Beispiel #30
0
        public void EVSE_IdsInHashSetTest()
        {
            var a = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "1");
            var b = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "2");
            var c = EVSE_Id.Parse(ChargingStationOperator_Id.Parse(Country.Germany, "822"), "1");

            var _HashSet = new HashSet <EVSE_Id>();

            Assert.AreEqual(0, _HashSet.Count);

            _HashSet.Add(a);
            Assert.AreEqual(1, _HashSet.Count);

            _HashSet.Add(b);
            Assert.AreEqual(2, _HashSet.Count);

            _HashSet.Add(c);
            Assert.AreEqual(2, _HashSet.Count);
        }