コード例 #1
0
            SendChargingNotificationsError(this ICPOClient        CPOClient,
                                           Session_Id             SessionId,
                                           Identification         Identification,
                                           EVSE_Id                EVSEId,
                                           ErrorClassTypes        ErrorType,

                                           CPOPartnerSession_Id?  CPOPartnerSessionId   = null,
                                           EMPPartnerSession_Id?  EMPPartnerSessionId   = null,
                                           String                 ErrorAdditionalInfo   = null,
                                           JObject                CustomData            = null,

                                           DateTime?              Timestamp             = null,
                                           CancellationToken?     CancellationToken     = null,
                                           EventTracking_Id       EventTrackingId       = null,
                                           TimeSpan?              RequestTimeout        = null)


                => CPOClient.SendChargingErrorNotification(
                       new ChargingErrorNotificationRequest(
                           SessionId,
                           Identification,
                           EVSEId,
                           ErrorType,

                           CPOPartnerSessionId,
                           EMPPartnerSessionId,
                           ErrorAdditionalInfo,
                           CustomData,

                           Timestamp,
                           CancellationToken,
                           EventTrackingId,
                           RequestTimeout ?? CPOClient.RequestTimeout));
コード例 #2
0
ファイル: EVSE_IdTests.cs プロジェクト: rewatt/WWCP_Core
        public void op_Inequality_Equals_Test()
        {
            var _EVSE_Id1 = EVSE_Id.Parse(EVSEOperator_Id.Parse(Country.Germany, "822"), "1");
            var _EVSE_Id2 = EVSE_Id.Parse(EVSEOperator_Id.Parse(Country.Germany, "822"), "1");

            Assert.IsFalse(_EVSE_Id1 != _EVSE_Id2);
        }
コード例 #3
0
ファイル: EVSE_IdTests.cs プロジェクト: rewatt/WWCP_Core
        public void op_Smaller_BothNull_Test()
        {
            EVSE_Id _EVSE_Id1 = null;
            EVSE_Id _EVSE_Id2 = null;

            Assert.Throws <ArgumentNullException>(() => { var x = _EVSE_Id1 < _EVSE_Id2; });
        }
コード例 #4
0
ファイル: EVSE_IdTests.cs プロジェクト: rewatt/WWCP_Core
        public void op_Inequality_NotEquals2_Test()
        {
            var _EVSE_Id1 = EVSE_Id.Parse(EVSEOperator_Id.Parse(Country.Germany, "822"), "5");
            var _EVSE_Id2 = EVSE_Id.Parse(EVSEOperator_Id.Parse(Country.Germany, "822"), "23");

            Assert.IsTrue(_EVSE_Id1 != _EVSE_Id2);
        }
コード例 #5
0
        AuthorizeRemoteReservationStart(this ICentralClient ICentralClient,
                                        Provider_Id ProviderId,
                                        EVSE_Id EVSEId,
                                        Identification Identification,
                                        Session_Id?SessionId = null,
                                        CPOPartnerSession_Id?CPOPartnerSessionId = null,
                                        EMPPartnerSession_Id?EMPPartnerSessionId = null,
                                        PartnerProduct_Id?PartnerProductId       = null,
                                        TimeSpan?Duration = null,

                                        DateTime?Timestamp = null,
                                        CancellationToken?CancellationToken = null,
                                        EventTracking_Id EventTrackingId    = null,
                                        TimeSpan?RequestTimeout             = null)


        => ICentralClient.AuthorizeRemoteReservationStart(new EMP.AuthorizeRemoteReservationStartRequest(ProviderId,
                                                                                                         EVSEId,
                                                                                                         Identification,
                                                                                                         SessionId,
                                                                                                         CPOPartnerSessionId,
                                                                                                         EMPPartnerSessionId,
                                                                                                         PartnerProductId,
                                                                                                         Duration,

                                                                                                         Timestamp,
                                                                                                         CancellationToken,
                                                                                                         EventTrackingId,
                                                                                                         RequestTimeout ?? ICentralClient.RequestTimeout));
コード例 #6
0
        GetServiceAuthorisation(this ICPOClient CPOClient,
                                Partner_Id PartnerId,
                                Operator_Id OperatorId,
                                EVSE_Id EVSEId,
                                User_Id UserId,
                                Service_Id RequestedServiceId,
                                Transaction_Id?TransactionId = null,
                                PartnerServiceSession_Id?PartnerServiceSessionId = null,

                                HTTPRequest HTTPRequest             = null,
                                DateTime?Timestamp                  = null,
                                CancellationToken?CancellationToken = null,
                                EventTracking_Id EventTrackingId    = null,
                                TimeSpan?RequestTimeout             = null)


        => CPOClient.GetServiceAuthorisation(new GetServiceAuthorisationRequest(PartnerId,
                                                                                OperatorId,
                                                                                EVSEId,
                                                                                UserId,
                                                                                RequestedServiceId,
                                                                                TransactionId,
                                                                                PartnerServiceSessionId,

                                                                                HTTPRequest,
                                                                                Timestamp,
                                                                                CancellationToken,
                                                                                EventTrackingId,
                                                                                RequestTimeout ?? CPOClient.RequestTimeout));
コード例 #7
0
ファイル: EVSE_IdTests.cs プロジェクト: rewatt/WWCP_Core
        public void op_Inequality_BothNull_Test()
        {
            EVSE_Id _EVSE_Id1 = null;
            EVSE_Id _EVSE_Id2 = null;

            Assert.IsFalse(_EVSE_Id1 != _EVSE_Id2);
        }
コード例 #8
0
        SetEVSEBusyStatus(this ICPOClient CPOClient,
                          Partner_Id PartnerId,
                          Operator_Id OperatorId,
                          EVSE_Id EVSEId,
                          DateTime StatusEventDate,
                          EVSEBusyStatusTypes BusyStatus,
                          Transaction_Id?TransactionId = null,
                          DateTime?BusyStatusUntil     = null,
                          String BusyStatusComment     = null,

                          HTTPRequest HTTPRequest             = null,
                          DateTime?Timestamp                  = null,
                          CancellationToken?CancellationToken = null,
                          EventTracking_Id EventTrackingId    = null,
                          TimeSpan?RequestTimeout             = null)


        => CPOClient.SetEVSEBusyStatus(new SetEVSEBusyStatusRequest(PartnerId,
                                                                    OperatorId,
                                                                    EVSEId,
                                                                    StatusEventDate,
                                                                    BusyStatus,
                                                                    TransactionId,
                                                                    BusyStatusUntil,
                                                                    BusyStatusComment,

                                                                    HTTPRequest,
                                                                    Timestamp,
                                                                    CancellationToken,
                                                                    EventTrackingId,
                                                                    RequestTimeout ?? CPOClient.RequestTimeout));
コード例 #9
0
 /// <summary>
 /// Create a status notification request.
 /// </summary>
 /// <param name="Timestamp">The time for which the status is reported.</param>
 /// <param name="ConnectorStatus">The current status of the connector.</param>
 /// <param name="EVSEId">The identification of the EVSE to which the connector belongs for which the the status is reported.</param>
 /// <param name="ConnectorId">The identification of the connector within the EVSE for which the status is reported.</param>
 /// <param name="CustomData">An optional custom data object to allow to store any kind of customer specific data.</param>
 public StatusNotificationRequest(DateTime Timestamp,
                                  ConnectorStatus ConnectorStatus,
                                  EVSE_Id EVSEId,
                                  Connector_Id ConnectorId,
                                  CustomData CustomData = null)
 {
     this.Timestamp       = Timestamp;
     this.ConnectorStatus = ConnectorStatus;
     this.EVSEId          = EVSEId;
     this.ConnectorId     = ConnectorId;
     this.CustomData      = CustomData;
 }
コード例 #10
0
 /// <summary>
 /// Create a new EVSE availability status.
 /// </summary>
 /// <param name="EVSEId">The EVSE identification.</param>
 /// <param name="StatusEventDate">The timestamp of the status change.</param>
 /// <param name="AvailabilityStatus">The EVSE availability status.</param>
 /// <param name="AvailabilityStatusUntil">An optional timestamp until which the given availability status is valid.</param>
 /// <param name="AvailabilityStatusComment">An optional comment about the availability status.</param>
 public EVSEAvailabilityStatus(EVSE_Id EVSEId,
                               DateTime StatusEventDate,
                               EVSEAvailabilityStatusTypes AvailabilityStatus,
                               DateTime?AvailabilityStatusUntil = null,
                               String AvailabilityStatusComment = null)
 {
     this.EVSEId                    = EVSEId;
     this.StatusEventDate           = StatusEventDate;
     this.AvailabilityStatus        = AvailabilityStatus;
     this.AvailabilityStatusUntil   = AvailabilityStatusUntil;
     this.AvailabilityStatusComment = AvailabilityStatusComment?.Trim();
 }
コード例 #11
0
 /// <summary>
 /// Create a new EVSE busy status.
 /// </summary>
 /// <param name="EVSEId">The EVSE identification.</param>
 /// <param name="StatusEventDate">The timestamp of the status change.</param>
 /// <param name="BusyStatus">The EVSE busy status.</param>
 /// <param name="BusyStatusUntil">An optional timestamp until which the given busy status is valid.</param>
 /// <param name="BusyStatusComment">An optional comment about the busy status.</param>
 public EVSEBusyStatus(EVSE_Id EVSEId,
                       DateTime StatusEventDate,
                       EVSEBusyStatusTypes BusyStatus,
                       DateTime?BusyStatusUntil = null,
                       String BusyStatusComment = null)
 {
     this.EVSEId            = EVSEId;
     this.StatusEventDate   = StatusEventDate;
     this.BusyStatus        = BusyStatus;
     this.BusyStatusUntil   = BusyStatusUntil;
     this.BusyStatusComment = BusyStatusComment?.Trim();
 }
コード例 #12
0
            SendChargingNotificationsEnd(this ICPOClient        CPOClient,
                                         Session_Id             SessionId,
                                         Identification         Identification,
                                         EVSE_Id                EVSEId,
                                         DateTime               ChargingStart,
                                         DateTime               ChargingEnd,

                                         CPOPartnerSession_Id?  CPOPartnerSessionId      = null,
                                         EMPPartnerSession_Id?  EMPPartnerSessionId      = null,
                                         DateTime?              SessionStart             = null,
                                         DateTime?              SessionEnd               = null,
                                         Decimal?               ConsumedEnergy           = null,
                                         Decimal?               MeterValueStart          = null,
                                         Decimal?               MeterValueEnd            = null,
                                         IEnumerable<Decimal>   MeterValuesInBetween     = null,
                                         Operator_Id?           OperatorId               = null,
                                         PartnerProduct_Id?     PartnerProductId         = null,
                                         DateTime?              PenaltyTimeStart         = null,
                                         JObject                CustomData               = null,

                                         DateTime?              Timestamp                = null,
                                         CancellationToken?     CancellationToken        = null,
                                         EventTracking_Id       EventTrackingId          = null,
                                         TimeSpan?              RequestTimeout           = null)


                => CPOClient.SendChargingEndNotification(
                       new ChargingEndNotificationRequest(
                           SessionId,
                           Identification,
                           EVSEId,
                           ChargingStart,
                           ChargingEnd,

                           CPOPartnerSessionId,
                           EMPPartnerSessionId,
                           SessionStart,
                           SessionEnd,
                           ConsumedEnergy,
                           MeterValueStart,
                           MeterValueEnd,
                           MeterValuesInBetween,
                           OperatorId,
                           PartnerProductId,
                           PenaltyTimeStart,
                           CustomData,

                           Timestamp,
                           CancellationToken,
                           EventTrackingId,
                           RequestTimeout ?? CPOClient.RequestTimeout));
コード例 #13
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;
        }
コード例 #14
0
ファイル: EVSE_IdTests.cs プロジェクト: rsegovia/WWCP_Core
        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);
        }
コード例 #15
0
        /// <summary>
        /// Create a new virtual charging station.
        /// </summary>
        /// <param name="ChargingStation">A charging station.</param>
        /// <param name="EVSEId">The EVSE identification for the EVSE to be created.</param>
        /// <param name="EVSEConfigurator">An optional delegate to configure the new (local) EVSE.</param>
        /// <param name="VirtualEVSEConfigurator">An optional delegate to configure the new EVSE.</param>
        /// <param name="OnSuccess">An optional delegate for reporting success.</param>
        /// <param name="OnError">An optional delegate for reporting an error.</param>
        public static EVSE CreateVirtualEVSE(this ChargingStation ChargingStation,
                                             EVSE_Id EVSEId,
                                             I18NString Description = null,
                                             EVSEAdminStatusTypes InitialAdminStatus = EVSEAdminStatusTypes.Operational,
                                             EVSEStatusTypes InitialStatus           = EVSEStatusTypes.Available,
                                             EnergyMeter_Id?EnergyMeterId            = null,
                                             String EllipticCurve = "P-256",
                                             ECPrivateKeyParameters PrivateKey           = null,
                                             PublicKeyCertificates PublicKeyCertificates = null,
                                             TimeSpan?SelfCheckTimeSpan     = null,
                                             UInt16 MaxAdminStatusListSize  = VirtualEVSE.DefaultMaxAdminStatusListSize,
                                             UInt16 MaxStatusListSize       = VirtualEVSE.DefaultMaxStatusListSize,
                                             Action <EVSE> EVSEConfigurator = null,
                                             Action <VirtualEVSE> VirtualEVSEConfigurator = null,
                                             Action <EVSE> OnSuccess = null,
                                             Action <ChargingStation, EVSE_Id> OnError = null)
        {
            #region Initial checks

            if (ChargingStation == null)
            {
                throw new ArgumentNullException(nameof(ChargingStation), "The given charging station must not be null!");
            }

            #endregion

            return(ChargingStation.CreateEVSE(EVSEId,
                                              EVSEConfigurator,
                                              newevse => {
                var virtualevse = new VirtualEVSE(newevse.Id,
                                                  ChargingStation.RoamingNetwork,
                                                  Description,
                                                  InitialAdminStatus,
                                                  InitialStatus,
                                                  EnergyMeterId,
                                                  EllipticCurve,
                                                  PrivateKey,
                                                  PublicKeyCertificates,
                                                  SelfCheckTimeSpan,
                                                  MaxAdminStatusListSize,
                                                  MaxStatusListSize);

                VirtualEVSEConfigurator?.Invoke(virtualevse);

                return virtualevse;
            },

                                              OnSuccess: OnSuccess,
                                              OnError:   OnError));
        }
コード例 #16
0
        /// <summary>
        /// Create a SetServiceAuthorisationRequest XML/SOAP request.
        /// </summary>
        /// <param name="PartnerId">The partner identification.</param>
        /// <param name="OperatorId">The operator identification.</param>
        /// <param name="TargetOperatorId">The target operator identification.</param>
        /// <param name="EVSEId">The EVSE identification.</param>
        /// <param name="UserId">The user identification.</param>
        /// <param name="RequestedServiceId">The service identification for which an authorisation is requested.</param>
        /// <param name="ServiceSessionId">The service session identification.</param>
        /// <param name="AuthorisationValue">Whether to start or stop the charging process.</param>
        /// <param name="IntermediateCDRRequested">Whether the eMSP wishes to receive intermediate charging session records.</param>
        /// 
        /// <param name="TransactionId">An optional transaction identification.</param>
        /// <param name="UserContractIdAlias">Anonymized alias of the contract id between the end-user and the eMSP.</param>
        /// <param name="MeterLimits">Meter limits for this authorisation: The eMSP can authorise the charge but for less than x Wh or y minutes, or z euros.</param>
        /// <param name="Parameter">eMSP parameter string (reserved for future use).</param>
        /// <param name="BookingId"></param>
        /// 
        /// <param name="HTTPRequest">The correlated HTTP request of this eMIP request.</param>
        /// <param name="Timestamp">The optional timestamp of the request.</param>
        /// <param name="CancellationToken">An optional token to cancel this request.</param>
        /// <param name="EventTrackingId">An optional event tracking identification for correlating this request with other events.</param>
        /// <param name="RequestTimeout">An optional timeout for this request.</param>
        public SetServiceAuthorisationRequest(HTTPRequest                HTTPRequest,
                                              Partner_Id                 PartnerId,
                                              Operator_Id                OperatorId,
                                              Operator_Id                TargetOperatorId,
                                              EVSE_Id                    EVSEId,
                                              User_Id                    UserId,
                                              Service_Id                 RequestedServiceId,
                                              ServiceSession_Id          ServiceSessionId,
                                              RemoteStartStopValues      AuthorisationValue,
                                              Boolean                    IntermediateCDRRequested,

                                              Transaction_Id?            TransactionId             = null,
                                              Contract_Id?               UserContractIdAlias       = null,
                                              IEnumerable<MeterReport>   MeterLimits               = null,
                                              String                     Parameter                 = null,
                                              Booking_Id?                BookingId                 = null,

                                              DateTime?                  Timestamp                 = null,
                                              CancellationToken?         CancellationToken         = null,
                                              EventTracking_Id           EventTrackingId           = null,
                                              TimeSpan?                  RequestTimeout            = null)

            : base(HTTPRequest,
                   PartnerId,
                   TransactionId,
                   Timestamp,
                   CancellationToken,
                   EventTrackingId,
                   RequestTimeout)

        {

            this.OperatorId                = OperatorId;
            this.TargetOperatorId          = TargetOperatorId;
            this.EVSEId                    = EVSEId;
            this.UserId                    = UserId;
            this.RequestedServiceId        = RequestedServiceId;
            this.ServiceSessionId          = ServiceSessionId;
            this.AuthorisationValue        = AuthorisationValue;
            this.IntermediateCDRRequested  = IntermediateCDRRequested;

            this.UserContractIdAlias       = UserContractIdAlias;
            this.MeterLimits               = MeterLimits;
            this.Parameter                 = Parameter;
            this.BookingId                 = BookingId;

        }
コード例 #17
0
        PullEVSEStatusById(this IEMPClient IEMPClient,
                           EVSE_Id EVSEId,
                           Provider_Id?ProviderId = null,

                           DateTime?Timestamp = null,
                           CancellationToken?CancellationToken = null,
                           EventTracking_Id EventTrackingId    = null,
                           TimeSpan?RequestTimeout             = null)


        => IEMPClient.PullEVSEStatusById(new PullEVSEStatusByIdRequest(ProviderId ?? IEMPClient.DefaultProviderId.Value,
                                                                       new EVSE_Id[] { EVSEId },

                                                                       Timestamp,
                                                                       CancellationToken,
                                                                       EventTrackingId,
                                                                       RequestTimeout ?? IEMPClient.RequestTimeout));
コード例 #18
0
        SetServiceAuthorisation(this IEMPClient EMPClient,
                                Partner_Id PartnerId,
                                Operator_Id OperatorId,
                                EVSE_Id EVSEId,
                                User_Id UserId,
                                Service_Id RequestedServiceId,
                                RemoteStartStopValues AuthorisationValue,
                                Boolean IntermediateCDRRequested,

                                Transaction_Id?TransactionId = null,
                                PartnerServiceSession_Id?PartnerServiceSessionId = null,
                                Contract_Id?UserContractIdAlias       = null,
                                IEnumerable <MeterReport> MeterLimits = null,
                                String Parameter                = null,
                                Booking_Id?BookingId            = null,
                                Booking_Id?SalePartnerBookingId = null,

                                HTTPRequest HTTPRequest             = null,
                                DateTime?Timestamp                  = null,
                                CancellationToken?CancellationToken = null,
                                EventTracking_Id EventTrackingId    = null,
                                TimeSpan?RequestTimeout             = null)


        => EMPClient.SetServiceAuthorisation(new SetServiceAuthorisationRequest(PartnerId,
                                                                                OperatorId,
                                                                                EVSEId,
                                                                                UserId,
                                                                                RequestedServiceId,
                                                                                AuthorisationValue,
                                                                                IntermediateCDRRequested,

                                                                                TransactionId,
                                                                                PartnerServiceSessionId,
                                                                                UserContractIdAlias,
                                                                                MeterLimits,
                                                                                Parameter,
                                                                                BookingId,
                                                                                SalePartnerBookingId,

                                                                                HTTPRequest,
                                                                                Timestamp,
                                                                                CancellationToken,
                                                                                EventTrackingId,
                                                                                RequestTimeout ?? EMPClient.RequestTimeout));
コード例 #19
0
ファイル: EVSE_IdTests.cs プロジェクト: rsegovia/WWCP_Core
        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);
        }
コード例 #20
0
        /// <summary>
        /// Create a SetEVSESyntheticStatus XML/SOAP request.
        /// </summary>
        /// <param name="PartnerId">The partner identification.</param>
        /// <param name="OperatorId">The operator identification.</param>
        /// <param name="EVSEId">The EVSE identification.</param>
        /// <param name="TransactionId">An optional transaction identification.</param>
        ///
        /// <param name="AvailabilityStatusEventDate">The timestamp of the status change.</param>
        /// <param name="AvailabilityStatus">The EVSE availability status.</param>
        /// <param name="AvailabilityStatusUntil">An optional timestamp until which the given availability status is valid.</param>
        /// <param name="AvailabilityStatusComment">An optional comment about the availability status.</param>
        ///
        /// <param name="BusyStatusEventDate">The timestamp of the status change.</param>
        /// <param name="BusyStatus">The EVSE busy status.</param>
        /// <param name="BusyStatusUntil">An optional timestamp until which the given busy status is valid.</param>
        /// <param name="BusyStatusComment">An optional comment about the busy status.</param>
        ///
        /// <param name="HTTPRequest">The correlated HTTP request of this eMIP request.</param>
        /// <param name="Timestamp">The optional timestamp of the request.</param>
        /// <param name="CancellationToken">An optional token to cancel this request.</param>
        /// <param name="EventTrackingId">An optional event tracking identification for correlating this request with other events.</param>
        /// <param name="RequestTimeout">An optional timeout for this request.</param>
        public SetEVSESyntheticStatusRequest(Partner_Id PartnerId,
                                             Operator_Id OperatorId,
                                             EVSE_Id EVSEId,
                                             Transaction_Id?TransactionId                   = null,
                                             DateTime?AvailabilityStatusEventDate           = null,
                                             EVSEAvailabilityStatusTypes?AvailabilityStatus = null,
                                             DateTime?AvailabilityStatusUntil               = null,
                                             String AvailabilityStatusComment               = null,
                                             DateTime?BusyStatusEventDate                   = null,
                                             EVSEBusyStatusTypes?BusyStatus                 = null,
                                             DateTime?BusyStatusUntil = null,
                                             String BusyStatusComment = null,

                                             HTTPRequest HTTPRequest             = null,
                                             DateTime?Timestamp                  = null,
                                             CancellationToken?CancellationToken = null,
                                             EventTracking_Id EventTrackingId    = null,
                                             TimeSpan?RequestTimeout             = null)

            : base(HTTPRequest,
                   PartnerId,
                   TransactionId,
                   Timestamp,
                   CancellationToken,
                   EventTrackingId,
                   RequestTimeout)

        {
            this.OperatorId = OperatorId;
            this.EVSEId     = EVSEId;

            this.AvailabilityStatusEventDate = AvailabilityStatusEventDate;
            this.AvailabilityStatus          = AvailabilityStatus;
            this.AvailabilityStatusUntil     = AvailabilityStatusUntil;
            this.AvailabilityStatusComment   = AvailabilityStatusComment?.Trim();

            this.BusyStatusEventDate = BusyStatusEventDate;
            this.BusyStatus          = BusyStatus;
            this.BusyStatusUntil     = BusyStatusUntil;
            this.BusyStatusComment   = BusyStatusComment?.Trim();
        }
コード例 #21
0
        /// <summary>
        /// Create a new MobileAuthorizeStart request.
        /// </summary>
        /// <param name="EVSEId">The EVSE identification.</param>
        /// <param name="EVCOIdWithPIN">The EVCO identification with its PIN.</param>
        /// <param name="ProductId">An optional charging product identification.</param>
        /// <param name="GetNewSession">Whether to start a new charging session or not.</param>
        ///
        /// <param name="Timestamp">The optional timestamp of the request.</param>
        /// <param name="CancellationToken">An optional token to cancel this request.</param>
        /// <param name="EventTrackingId">An optional event tracking identification for correlating this request with other events.</param>
        /// <param name="RequestTimeout">An optional timeout for this request.</param>
        public MobileAuthorizeStartRequest(EVSE_Id EVSEId,
                                           QRCodeIdentification QRCodeIdentification,
                                           PartnerProduct_Id?PartnerProductId = null,
                                           Boolean?GetNewSession = null,

                                           DateTime?Timestamp = null,
                                           CancellationToken?CancellationToken = null,
                                           EventTracking_Id EventTrackingId    = null,
                                           TimeSpan?RequestTimeout             = null)

            : base(Timestamp,
                   CancellationToken,
                   EventTrackingId,
                   RequestTimeout)

        {
            this.EVSEId = EVSEId;
            this.QRCodeIdentification = QRCodeIdentification;
            this.PartnerProductId     = PartnerProductId;
            this.GetNewSession        = GetNewSession;
        }
コード例 #22
0
        MobileAuthorizeStart(this IMobileClient IMobileClient,
                             EVSE_Id EVSEId,
                             QRCodeIdentification QRCodeIdentification,
                             PartnerProduct_Id?PartnerProductId = null,
                             Boolean?GetNewSession = null,

                             DateTime?Timestamp = null,
                             CancellationToken?CancellationToken = null,
                             EventTracking_Id EventTrackingId    = null,
                             TimeSpan?RequestTimeout             = null)


        => IMobileClient.MobileAuthorizeStart(new MobileAuthorizeStartRequest(EVSEId,
                                                                              QRCodeIdentification,
                                                                              PartnerProductId,
                                                                              GetNewSession,

                                                                              Timestamp,
                                                                              CancellationToken,
                                                                              EventTrackingId,
                                                                              RequestTimeout ?? IMobileClient.RequestTimeout));
コード例 #23
0
            SendChargingNotificationsStart(this ICPOClient        CPOClient,
                                           Session_Id             SessionId,
                                           Identification         Identification,
                                           EVSE_Id                EVSEId,
                                           DateTime               ChargingStart,

                                           CPOPartnerSession_Id?  CPOPartnerSessionId   = null,
                                           EMPPartnerSession_Id?  EMPPartnerSessionId   = null,
                                           DateTime?              SessionStart          = null,
                                           Decimal?               MeterValueStart       = null,
                                           Operator_Id?           OperatorId            = null,
                                           PartnerProduct_Id?     PartnerProductId      = null,
                                           JObject                CustomData            = null,

                                           DateTime?              Timestamp             = null,
                                           CancellationToken?     CancellationToken     = null,
                                           EventTracking_Id       EventTrackingId       = null,
                                           TimeSpan?              RequestTimeout        = null)


                => CPOClient.SendChargingStartNotification(
                       new ChargingStartNotificationRequest(
                           SessionId,
                           Identification,
                           EVSEId,
                           ChargingStart,

                           CPOPartnerSessionId,
                           EMPPartnerSessionId,
                           SessionStart,
                           MeterValueStart,
                           OperatorId,
                           PartnerProductId,
                           CustomData,

                           Timestamp,
                           CancellationToken,
                           EventTrackingId,
                           RequestTimeout ?? CPOClient.RequestTimeout));
コード例 #24
0
        RemoteStop(this IEMPClient IEMPClient,
                   Session_Id SessionId,
                   Provider_Id ProviderId,
                   EVSE_Id EVSEId,
                   CPOPartnerSession_Id?CPOPartnerSessionId = null,
                   EMPPartnerSession_Id?EMPPartnerSessionId = null,

                   DateTime?Timestamp = null,
                   CancellationToken?CancellationToken = null,
                   EventTracking_Id EventTrackingId    = null,
                   TimeSpan?RequestTimeout             = null)


        => IEMPClient.AuthorizeRemoteStop(new AuthorizeRemoteStopRequest(SessionId,
                                                                         ProviderId,
                                                                         EVSEId,
                                                                         CPOPartnerSessionId,
                                                                         EMPPartnerSessionId,

                                                                         Timestamp,
                                                                         CancellationToken,
                                                                         EventTrackingId,
                                                                         RequestTimeout ?? IEMPClient.RequestTimeout));
コード例 #25
0
        /// <summary>
        /// Create an OICP AuthorizeRemoteStopRequest XML/SOAP request.
        /// </summary>
        /// <param name="SessionId">A charging session identification.</param>
        /// <param name="ProviderId">An e-mobility provider identification.</param>
        /// <param name="EVSEId">The EVSE identification.</param>
        /// <param name="CPOPartnerSessionId">An optional CPO partner session identification.</param>
        /// <param name="EMPPartnerSessionId">An optional EMP partner session identification.</param>
        ///
        /// <param name="Timestamp">The optional timestamp of the request.</param>
        /// <param name="CancellationToken">An optional token to cancel this request.</param>
        /// <param name="EventTrackingId">An optional event tracking identification for correlating this request with other events.</param>
        /// <param name="RequestTimeout">An optional timeout for this request.</param>
        public AuthorizeRemoteStopRequest(Session_Id SessionId,
                                          Provider_Id ProviderId,
                                          EVSE_Id EVSEId,
                                          CPOPartnerSession_Id?CPOPartnerSessionId = null,
                                          EMPPartnerSession_Id?EMPPartnerSessionId = null,

                                          DateTime?Timestamp = null,
                                          CancellationToken?CancellationToken = null,
                                          EventTracking_Id EventTrackingId    = null,
                                          TimeSpan?RequestTimeout             = null)

            : base(Timestamp,
                   CancellationToken,
                   EventTrackingId,
                   RequestTimeout)

        {
            this.SessionId           = SessionId;
            this.ProviderId          = ProviderId;
            this.EVSEId              = EVSEId;
            this.CPOPartnerSessionId = CPOPartnerSessionId;
            this.EMPPartnerSessionId = EMPPartnerSessionId;
        }
コード例 #26
0
 public void AddEVSEId(EVSE_Id EVSEId)
 {
     _EVSEIds.Add(EVSEId);
 }
コード例 #27
0
ファイル: EVSETests.cs プロジェクト: xrjob/WWCP_OCPI
        public static void EVSE_SerializeDeserialize_Test01()
        {
            #region Define EVSE1

            var EVSE1 = new EVSE(
                EVSE_UId.Parse("DE*GEF*E*LOC0001*1"),
                StatusTypes.AVAILABLE,
                new Connector[] {
                new Connector(
                    Connector_Id.Parse("1"),
                    ConnectorTypes.IEC_62196_T2,
                    ConnectorFormats.SOCKET,
                    PowerTypes.AC_3_PHASE,
                    400,
                    30,
                    12,
                    new Tariff_Id[] {
                    Tariff_Id.Parse("DE*GEF*T0001"),
                    Tariff_Id.Parse("DE*GEF*T0002")
                },
                    URL.Parse("https://open.charging.cloud/terms"),
                    DateTime.Parse("2020-09-21T00:00:00Z")
                    ),
                new Connector(
                    Connector_Id.Parse("2"),
                    ConnectorTypes.IEC_62196_T2_COMBO,
                    ConnectorFormats.CABLE,
                    PowerTypes.AC_3_PHASE,
                    400,
                    20,
                    8,
                    new Tariff_Id[] {
                    Tariff_Id.Parse("DE*GEF*T0003"),
                    Tariff_Id.Parse("DE*GEF*T0004")
                },
                    URL.Parse("https://open.charging.cloud/terms"),
                    DateTime.Parse("2020-09-21T00:00:00Z")
                    )
            },
                EVSE_Id.Parse("DE*GEF*E*LOC0001*1"),
                new StatusSchedule[] {
                new StatusSchedule(
                    StatusTypes.INOPERATIVE,
                    DateTime.Parse("2020-09-22T00:00:00.000Z"),
                    DateTime.Parse("2020-09-23T00:00:00.000Z")
                    ),
                new StatusSchedule(
                    StatusTypes.OUTOFORDER,
                    DateTime.Parse("2020-12-30T00:00:00.000Z"),
                    DateTime.Parse("2020-12-31T00:00:00.000Z")
                    )
            },
                new CapabilityTypes[] {
                CapabilityTypes.RFID_READER,
                CapabilityTypes.RESERVABLE
            },
                "1. Stock",
                GeoCoordinate.Parse(10.1, 20.2),
                "Ladestation #1",
                new DisplayText[] {
                DisplayText.Create(Languages.de, "Bitte klingeln!"),
                DisplayText.Create(Languages.en, "Ken sent me!")
            },
                new ParkingRestrictions[] {
                ParkingRestrictions.EV_ONLY,
                ParkingRestrictions.PLUGGED
            },
                new Image[] {
                new Image(
                    URL.Parse("http://example.com/pinguine.jpg"),
                    ImageFileType.jpeg,
                    ImageCategories.OPERATOR,
                    100,
                    150,
                    URL.Parse("http://example.com/kleine_pinguine.jpg")
                    ),
                new Image(
                    URL.Parse("http://example.com/wellensittiche.jpg"),
                    ImageFileType.png,
                    ImageCategories.ENTRANCE,
                    200,
                    300,
                    URL.Parse("http://example.com/kleine_wellensittiche.jpg")
                    )
            },
                DateTime.Parse("2020-09-18T00:00:00Z")
                );

            #endregion

            var JSON = EVSE1.ToJSON();

            Assert.AreEqual("DE*GEF*E*LOC0001*1", JSON["uid"].Value <String>());
            Assert.AreEqual("AVAILABLE", JSON["status"].Value <String>());
            Assert.AreEqual("1", JSON["connectors"]          [0]["id"].Value <String>());
            Assert.AreEqual("2", JSON["connectors"]          [1]["id"].Value <String>());
            Assert.AreEqual("DE*GEF*E*LOC0001*1", JSON["evse_id"].Value <String>());
            Assert.AreEqual("INOPERATIVE", JSON["status_schedule"]     [0]["status"].Value <String>());
            Assert.AreEqual("2020-09-22T00:00:00.000Z", JSON["status_schedule"]     [0]["period_begin"].Value <String>());
            Assert.AreEqual("2020-09-23T00:00:00.000Z", JSON["status_schedule"]     [0]["period_end"].Value <String>());
            Assert.AreEqual("OUTOFORDER", JSON["status_schedule"]     [1]["status"].Value <String>());
            Assert.AreEqual("2020-12-30T00:00:00.000Z", JSON["status_schedule"]     [1]["period_begin"].Value <String>());
            Assert.AreEqual("2020-12-31T00:00:00.000Z", JSON["status_schedule"]     [1]["period_end"].Value <String>());
            Assert.AreEqual("RFID_READER", JSON["capabilities"]        [0].Value <String>());
            Assert.AreEqual("RESERVABLE", JSON["capabilities"]        [1].Value <String>());
            Assert.AreEqual("1. Stock", JSON["floor_level"].Value <String>());
            Assert.AreEqual("10.1000000", JSON["coordinates"]            ["latitude"].Value <String>());
            Assert.AreEqual("20.2000000", JSON["coordinates"]            ["longitude"].Value <String>());
            Assert.AreEqual("Ladestation #1", JSON["physical_reference"].Value <String>());
            Assert.AreEqual("de", JSON["directions"]          [0]["language"].Value <String>());
            Assert.AreEqual("Bitte klingeln!", JSON["directions"]          [0]["text"].Value <String>());
            Assert.AreEqual("en", JSON["directions"]          [1]["language"].Value <String>());
            Assert.AreEqual("Ken sent me!", JSON["directions"]          [1]["text"].Value <String>());
            Assert.AreEqual("EV_ONLY", JSON["parking_restrictions"][0].Value <String>());
            Assert.AreEqual("PLUGGED", JSON["parking_restrictions"][1].Value <String>());
            Assert.AreEqual("http://example.com/pinguine.jpg", JSON["images"]              [0]["url"].Value <String>());
            Assert.AreEqual("http://example.com/kleine_pinguine.jpg", JSON["images"]              [0]["thumbnail"].Value <String>());
            Assert.AreEqual("OPERATOR", JSON["images"]              [0]["category"].Value <String>());
            Assert.AreEqual("jpeg", JSON["images"]              [0]["type"].Value <String>());
            Assert.AreEqual(100, JSON["images"]              [0]["width"].Value <UInt16>());
            Assert.AreEqual(150, JSON["images"]              [0]["height"].Value <UInt16>());
            Assert.AreEqual("http://example.com/wellensittiche.jpg", JSON["images"]              [1]["url"].Value <String>());
            Assert.AreEqual("2020-09-18T00:00:00.000Z", JSON["last_updated"].Value <String>());

            Assert.IsTrue(EVSE.TryParse(JSON, out EVSE EVSE2, out String ErrorResponse));
            Assert.IsNull(ErrorResponse);

            Assert.AreEqual(EVSE1.UId, EVSE2.UId);
            Assert.AreEqual(EVSE1.Status, EVSE2.Status);
            Assert.AreEqual(EVSE1.Connectors, EVSE2.Connectors);
            Assert.AreEqual(EVSE1.EVSEId, EVSE2.EVSEId);
            Assert.AreEqual(EVSE1.StatusSchedule, EVSE2.StatusSchedule);
            Assert.AreEqual(EVSE1.Capabilities, EVSE2.Capabilities);
            Assert.AreEqual(EVSE1.FloorLevel, EVSE2.FloorLevel);
            Assert.AreEqual(EVSE1.Coordinates, EVSE2.Coordinates);
            Assert.AreEqual(EVSE1.PhysicalReference, EVSE2.PhysicalReference);
            Assert.AreEqual(EVSE1.Directions, EVSE2.Directions);
            Assert.AreEqual(EVSE1.ParkingRestrictions, EVSE2.ParkingRestrictions);
            Assert.AreEqual(EVSE1.Images, EVSE2.Images);
            Assert.AreEqual(EVSE1.LastUpdated.ToIso8601(), EVSE2.LastUpdated.ToIso8601());
        }
コード例 #28
0
        public static void CDR_SerializeDeserialize_Test01()
        {
            #region Defined CDR1

            var CDR1 = new CDR(CountryCode.Parse("DE"),
                               Party_Id.Parse("GEF"),
                               CDR_Id.Parse("CDR0001"),
                               DateTime.Parse("2020-04-12T18:20:19Z"),
                               DateTime.Parse("2020-04-12T22:20:19Z"),
                               new CDRToken(
                                   Token_Id.Parse("1234"),
                                   TokenTypes.RFID,
                                   Contract_Id.Parse("C1234")
                                   ),
                               AuthMethods.AUTH_REQUEST,
                               new CDRLocation(
                                   Location_Id.Parse("LOC0001"),
                                   "Biberweg 18",
                                   "Jena",
                                   "Deutschland",
                                   GeoCoordinate.Parse(10, 20),
                                   EVSE_UId.Parse("DE*GEF*E*LOC0001*1"),
                                   EVSE_Id.Parse("DE*GEF*E*LOC0001*1"),
                                   Connector_Id.Parse("1"),
                                   ConnectorTypes.IEC_62196_T2,
                                   ConnectorFormats.SOCKET,
                                   PowerTypes.AC_3_PHASE,
                                   "Name?",
                                   "07749"
                                   ),
                               Currency.EUR,

                               new ChargingPeriod[] {
                new ChargingPeriod(
                    DateTime.Parse("2020-04-12T18:21:49Z"),
                    new CDRDimension[] {
                    new CDRDimension(
                        CDRDimensions.ENERGY,
                        1.33M
                        )
                },
                    Tariff_Id.Parse("DE*GEF*T0001")
                    ),
                new ChargingPeriod(
                    DateTime.Parse("2020-04-12T18:21:50Z"),
                    new CDRDimension[] {
                    new CDRDimension(
                        CDRDimensions.TIME,
                        5.12M
                        )
                },
                    Tariff_Id.Parse("DE*GEF*T0002")
                    )
            },

                               // Total costs
                               new Price(
                                   10.00,
                                   11.60
                                   ),

                               // Total Energy
                               50.00M,

                               // Total time
                               TimeSpan.FromMinutes(30),

                               Session_Id.Parse("0815"),
                               AuthorizationReference.Parse("Auth0815"),
                               Meter_Id.Parse("Meter0815"),

                               // OCPI Computer Science Extentions
                               new EnergyMeter(
                                   Meter_Id.Parse("Meter0815"),
                                   "EnergyMeter Model #1",
                                   "hw. v1.80",
                                   "fw. v1.20",
                                   "Energy Metering Services",
                                   null,
                                   null
                                   ),

                               // OCPI Computer Science Extentions
                               new TransparencySoftware[] {
                new TransparencySoftware(
                    "Chargy Transparency Software Desktop Application",
                    "v1.00",
                    LegalStatus.LegallyBinding,
                    OpenSourceLicenses.GPL3,
                    "GraphDefined GmbH",
                    URL.Parse("https://open.charging.cloud/logo.svg"),
                    URL.Parse("https://open.charging.cloud/Chargy/howto"),
                    URL.Parse("https://open.charging.cloud/Chargy"),
                    URL.Parse("https://github.com/OpenChargingCloud/ChargyDesktopApp")
                    ),
                new TransparencySoftware(
                    "Chargy Transparency Software Mobile Application",
                    "v1.00",
                    LegalStatus.ForInformationOnly,
                    OpenSourceLicenses.GPL3,
                    "GraphDefined GmbH",
                    URL.Parse("https://open.charging.cloud/logo.svg"),
                    URL.Parse("https://open.charging.cloud/Chargy/howto"),
                    URL.Parse("https://open.charging.cloud/Chargy"),
                    URL.Parse("https://github.com/OpenChargingCloud/ChargyMobileApp")
                    )
            },

                               new Tariff[] {
                new Tariff(
                    CountryCode.Parse("DE"),
                    Party_Id.Parse("GEF"),
                    Tariff_Id.Parse("TARIFF0001"),
                    Currency.EUR,
                    new TariffElement[] {
                    new TariffElement(
                        new PriceComponent[] {
                        PriceComponent.ChargingTime(
                            TimeSpan.FromSeconds(300),
                            2.00M,
                            0.10M
                            )
                    },
                        new TariffRestrictions [] {
                        new TariffRestrictions(
                            Time.FromHourMin(08, 00),                                 // Start time
                            Time.FromHourMin(18, 00),                                 // End time
                            DateTime.Parse("2020-12-01"),                             // Start timestamp
                            DateTime.Parse("2020-12-31"),                             // End timestamp
                            1.12M,                                                    // MinkWh
                            5.67M,                                                    // MaxkWh
                            1.34M,                                                    // MinCurrent
                            8.89M,                                                    // MaxCurrent
                            1.49M,                                                    // MinPower
                            9.91M,                                                    // MaxPower
                            TimeSpan.FromMinutes(10),                                 // MinDuration
                            TimeSpan.FromMinutes(30),                                 // MaxDuration
                            new DayOfWeek[] {
                            DayOfWeek.Monday,
                            DayOfWeek.Tuesday
                        },
                            ReservationRestrictionTypes.RESERVATION
                            )
                    }
                        )
                },
                    TariffTypes.PROFILE_GREEN,
                    new DisplayText[] {
                    new DisplayText(Languages.de, "Hallo Welt!"),
                    new DisplayText(Languages.en, "Hello world!"),
                },
                    URL.Parse("https://open.charging.cloud"),
                    new Price(                    // Min Price
                        1.10,
                        1.26
                        ),
                    new Price(                    // Max Price
                        2.20,
                        2.52
                        ),
                    DateTime.Parse("2020-12-01"),                    // Start timestamp
                    DateTime.Parse("2020-12-31"),                    // End timestamp
                    new EnergyMix(
                        true,
                        new EnergySource[] {
                    new EnergySource(
                        EnergySourceCategories.SOLAR,
                        80
                        ),
                    new EnergySource(
                        EnergySourceCategories.WIND,
                        20
                        )
                },
                        new EnvironmentalImpact[] {
                    new EnvironmentalImpact(
                        EnvironmentalImpactCategories.CARBON_DIOXIDE,
                        0.1
                        )
                },
                        "Stadtwerke Jena-Ost",
                        "New Green Deal"
                        ),
                    DateTime.Parse("2020-09-22")
                    )
            },

                               new SignedData(
                                   EncodingMethod.GraphDefiened,
                                   new SignedValue[] {
                new SignedValue(
                    SignedValueNature.START,
                    "PlainStartValue",
                    "SignedStartValue"
                    ),
                new SignedValue(
                    SignedValueNature.INTERMEDIATE,
                    "PlainIntermediateValue",
                    "SignedIntermediateValue"
                    ),
                new SignedValue(
                    SignedValueNature.END,
                    "PlainEndValue",
                    "SignedEndValue"
                    )
            },
                                   1,     // Encoding method version
                                   null,  // Public key
                                   "https://open.charging.cloud/pools/1/stations/1/evse/1/publicKey"
                                   ),

                               // Total Fixed Costs
                               new Price(
                                   20.00,
                                   23.10
                                   ),

                               // Total Energy Cost
                               new Price(
                                   20.00,
                                   23.10
                                   ),

                               // Total Time Cost
                               new Price(
                                   20.00,
                                   23.10
                                   ),

                               // Total Parking Time
                               TimeSpan.FromMinutes(120),

                               // Total Parking Cost
                               new Price(
                                   20.00,
                                   23.10
                                   ),

                               // Total Reservation Cost
                               new Price(
                                   20.00,
                                   23.10
                                   ),

                               "Remark!",
                               InvoiceReference_Id.Parse("Invoice:0815"),
                               true, // IsCredit
                               CreditReference_Id.Parse("Credit:0815"),

                               DateTime.Parse("2020-09-12")

                               );

            #endregion

            var JSON = CDR1.ToJSON();

            Assert.AreEqual("DE", JSON["country_code"].Value <String>());
            Assert.AreEqual("GEF", JSON["party_id"].Value <String>());
            Assert.AreEqual("CDR0001", JSON["id"].Value <String>());


            Assert.IsTrue(CDR.TryParse(JSON, out CDR CDR2, out String ErrorResponse));
            Assert.IsNull(ErrorResponse);

            Assert.AreEqual(CDR1.CountryCode, CDR2.CountryCode);
            Assert.AreEqual(CDR1.PartyId, CDR2.PartyId);
            Assert.AreEqual(CDR1.Id, CDR2.Id);

            Assert.AreEqual(CDR1.Start.ToIso8601(), CDR2.Start.ToIso8601());
            Assert.AreEqual(CDR1.End.ToIso8601(), CDR2.End.ToIso8601());
            Assert.AreEqual(CDR1.CDRToken, CDR2.CDRToken);
            Assert.AreEqual(CDR1.AuthMethod, CDR2.AuthMethod);
            Assert.AreEqual(CDR1.Location, CDR2.Location);
            Assert.AreEqual(CDR1.Currency, CDR2.Currency);
            Assert.AreEqual(CDR1.ChargingPeriods, CDR2.ChargingPeriods);
            Assert.AreEqual(CDR1.TotalCosts, CDR2.TotalCosts);
            Assert.AreEqual(CDR1.TotalEnergy, CDR2.TotalEnergy);
            Assert.AreEqual(CDR1.TotalTime, CDR2.TotalTime);

            Assert.AreEqual(CDR1.SessionId, CDR2.SessionId);
            Assert.AreEqual(CDR1.AuthorizationReference, CDR2.AuthorizationReference);
            Assert.AreEqual(CDR1.MeterId, CDR2.MeterId);
            Assert.AreEqual(CDR1.EnergyMeter, CDR2.EnergyMeter);
            Assert.AreEqual(CDR1.TransparencySoftwares, CDR2.TransparencySoftwares);
            Assert.AreEqual(CDR1.Tariffs, CDR2.Tariffs);
            Assert.AreEqual(CDR1.SignedData, CDR2.SignedData);
            Assert.AreEqual(CDR1.TotalFixedCosts, CDR2.TotalFixedCosts);
            Assert.AreEqual(CDR1.TotalEnergyCost, CDR2.TotalEnergyCost);
            Assert.AreEqual(CDR1.TotalTimeCost, CDR2.TotalTimeCost);
            Assert.AreEqual(CDR1.TotalParkingTime, CDR2.TotalParkingTime);
            Assert.AreEqual(CDR1.TotalParkingCost, CDR2.TotalParkingCost);
            Assert.AreEqual(CDR1.TotalReservationCost, CDR2.TotalReservationCost);
            Assert.AreEqual(CDR1.Remark, CDR2.Remark);
            Assert.AreEqual(CDR1.InvoiceReferenceId, CDR2.InvoiceReferenceId);
            Assert.AreEqual(CDR1.Credit, CDR2.Credit);
            Assert.AreEqual(CDR1.CreditReferenceId, CDR2.CreditReferenceId);

            Assert.AreEqual(CDR1.LastUpdated.ToIso8601(), CDR2.LastUpdated.ToIso8601());
        }