コード例 #1
0
        public override void Encode()
        {
            encodeBuf.Clear();

            base.Decode();

            encodeBuf.AddRange(AddString(TxnType, 2));
            encodeBuf.AddRange(AddString(DeviceId, 8));

            encodeBuf.AddRange(AddString(OperatorId, 6));
            encodeBuf.AddRange(AddString(ShiftId.PadLeft(10, '0'), 10));
            encodeBuf.AddRange(AddString(SerialNumber.PadLeft(4, '0'), 4));

            encodeBuf.AddRange(AddString(TxnTime, 14));

            encodeBuf.AddRange(AddString(StationId, 4));

            encodeBuf.AddRange(AddString(TicketId, 16));

            encodeBuf.AddRange(AddString(TicketMainType, 2));

            encodeBuf.AddRange(AddString(TicketSubType, 2));

            encodeBuf.AddRange(AddString(IntegrationRemain.PadLeft(10, '0'), 10));

            encodeBuf.AddRange(AddString(IntegrationWithdraw.PadLeft(10, '0'), 10));

            encodeBuf.AddRange(AddString(Spare.PadLeft(12, '0'), 12));
        }
コード例 #2
0
        public override void Encode()
        {
            encodeBuf.Clear();

            base.Decode();

            encodeBuf.AddRange(AddString(TxnType, 2));
            encodeBuf.AddRange(AddString(DeviceId, 8));

            encodeBuf.AddRange(AddString(OperatorId, 6));
            encodeBuf.AddRange(AddString(ShiftId.PadLeft(10, '0'), 10));
            encodeBuf.AddRange(AddString(SerialNumber.PadLeft(4, '0'), 4));

            encodeBuf.AddRange(AddString(TxnTime, 14));

            encodeBuf.AddRange(AddString(StationId, 4));

            encodeBuf.AddRange(AddString(DestinationStationId, 4));

            encodeBuf.AddRange(AddString(ReportDate, 8));

            encodeBuf.AddRange(AddString(TicketMainType, 2));

            encodeBuf.AddRange(AddString(TicketSubType, 2));

            encodeBuf.AddRange(AddString(UnitPrice.PadLeft(16, '0'), 16));

            encodeBuf.AddRange(AddString(TotalAmount.PadLeft(4, '0'), 4));

            encodeBuf.AddRange(AddString(TxTotalAmt.PadLeft(16, '0'), 16));

            encodeBuf.AddRange(AddString(ManualId, 10));

            encodeBuf.AddRange(AddString(Spare.PadLeft(4, '0'), 4));
        }
コード例 #3
0
        public override void Encode()
        {
            encodeBuf.Clear();

            base.Decode();

            encodeBuf.AddRange(AddString(TxnType, 2));
            encodeBuf.AddRange(AddString(DeviceId, 8));

            encodeBuf.AddRange(AddString(OperatorId, 6));
            encodeBuf.AddRange(AddString(ShiftId.PadLeft(10, '0'), 10));

            encodeBuf.AddRange(AddString(TxnTime, 14));

            encodeBuf.AddRange(AddString(StationId, 4));

            encodeBuf.AddRange(AddString(TicketLogicalId, 16));

            encodeBuf.AddRange(AddString(TicketMainType, 2));

            encodeBuf.AddRange(AddString(TicketSubType, 2));

            encodeBuf.AddRange(AddString(CredentialsType, 1));

            encodeBuf.AddRange(AddString(CredentialsNumber, 20));

            encodeBuf.AddRange(AddString(OriginalLogicalId, 16));

            encodeBuf.AddRange(AddString(OriginalCardStatus, 2));

            encodeBuf.AddRange(AddString(Spare.PadLeft(17, '0'), 17));
        }
コード例 #4
0
        public override void Encode()
        {
            encodeBuf.Clear();

            encodeBuf.AddRange(AddString(DeviceId, 8));
            encodeBuf.AddRange(AddString(OperateTime, 14));
            encodeBuf.AddRange(AddString(OperatorId.PadLeft(6, ' '), 6));
            encodeBuf.AddRange(AddString(ShiftId.PadLeft(10, '0'), 10));
            encodeBuf.AddRange(AddString(ShiftEvent, 1));
        }
コード例 #5
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 17;
         hash = hash * 23 + (BusinessEntityId == default(int) ? 0 : BusinessEntityId.GetHashCode());
         hash = hash * 23 + (DepartmentId == default(short) ? 0 : DepartmentId.GetHashCode());
         hash = hash * 23 + (EndDate == null ? 0 : EndDate.GetHashCode());
         hash = hash * 23 + (ModifiedDate == default(DateTime) ? 0 : ModifiedDate.GetHashCode());
         hash = hash * 23 + (ShiftId == default(byte) ? 0 : ShiftId.GetHashCode());
         hash = hash * 23 + (StartDate == default(DateTime) ? 0 : StartDate.GetHashCode());
         return(hash);
     }
 }
コード例 #6
0
ファイル: ShiftFeatures.cs プロジェクト: cjjohansen/BDDXunit
        public void approving_a_shift(ShiftId shiftId, LocalDate date, Shift aShift)
        {
            "Given an unapproved shift".x(() =>
            {
                aShift.IsApproved.Should().BeFalse();
            });

            "When approving the shift"
            .x(() => aShift.Approve());

            $"Then the shift should be approved"
            .x(() => aShift.IsApproved.Should().Be(true));
            $"And a ShiftApproved event should be raised"
            .x(() => aShift.RaisedEvents.Should().ContainSingle(x => x.GetType() == typeof(ShiftApproved)));
        }
コード例 #7
0
ファイル: ShiftFeatures.cs プロジェクト: cjjohansen/BDDXunit
        public void creating_a_shift(ShiftId shiftId, LocalDate date)
        {
            Shift result = null;

            $"Given shiftId is {shiftId}".x(() => { });

            $"And date is {date}".x(() => { });

            $"When creating a shift with {nameof(shiftId)} and {nameof(date)}"
            .x(() => result = new Shift(shiftId, date));

            $"Then the shift should have Id equal to {shiftId} "
            .x(() => result.Id.Should().Be(shiftId));
            $"And the shift should have OpeningDate equal to {date.ToString()}"
            .x(() => result.OpeningDate.Should().Be(date));
        }
コード例 #8
0
        public override void Encode()
        {
            encodeBuf.Clear();

            encodeBuf.AddRange(AddString(LineId, 2));
            encodeBuf.AddRange(AddString(StationId, 4));
            encodeBuf.AddRange(AddString(OperatorId, 6));
            encodeBuf.AddRange(AddString(DoublePrivilegeId, 6));
            encodeBuf.AddRange(AddString(OperateTime, 14));
            encodeBuf.AddRange(AddString(OperateType, 2));
            encodeBuf.AddRange(AddString(CashKind, 2));

            encodeBuf.AddRange(AddString(ChangeAmt.PadLeft(8, '0'), 8));
            encodeBuf.AddRange(AddString(RemainAmt.PadLeft(8, '0'), 8));

            encodeBuf.AddRange(AddString(ShiftId.PadLeft(10, ' '), 10));
            encodeBuf.AddRange(AddString(DeviceId.PadLeft(8, ' '), 8));
            encodeBuf.AddRange(AddString(ShiftFlag.PadLeft(2, ' '), 2));
        }
コード例 #9
0
        public override void Encode()
        {
            encodeBuf.Clear();

            base.Decode();

            encodeBuf.AddRange(AddString(TxnType, 2));

            encodeBuf.AddRange(AddString(DeviceId, 8));

            encodeBuf.AddRange(AddString(OperatorId, 6));

            encodeBuf.AddRange(AddString(ShiftId.PadLeft(10, '0'), 10));

            encodeBuf.AddRange(AddString(SerialNumber.PadLeft(4, '0'), 4));

            encodeBuf.AddRange(AddString(StationId, 4));

            encodeBuf.AddRange(AddString(NonInstantRefundFlag, 1));

            encodeBuf.AddRange(AddString(TicketCardId, 16));
            encodeBuf.AddRange(AddString(TicketMainType, 2));

            encodeBuf.AddRange(AddString(TicketSubType, 2));

            encodeBuf.AddRange(AddString(TxTotalAmt.PadLeft(8, '0'), 8));

            encodeBuf.AddRange(AddString(CardRemainAmt.PadLeft(8, '0'), 8));

            encodeBuf.AddRange(AddString(TicketDeposite.PadLeft(8, '0'), 8));

            encodeBuf.AddRange(AddString(ProcessingFee.PadLeft(8, '0'), 8));

            encodeBuf.AddRange(AddString(ManualId, 10));

            encodeBuf.AddRange(AddString(TxnTime, 14));

            encodeBuf.AddRange(AddString(CredentialsType, 1));

            encodeBuf.AddRange(AddString(CredentialsNumber, 20));

            encodeBuf.AddRange(AddString(Spare.PadLeft(48, '0'), 48));
        }
コード例 #10
0
 public override void Encode()
 {
     encodeBuf.Clear();
     encodeBuf.AddRange(AddString(TxnType, 2));
     encodeBuf.AddRange(AddString(DeviceId, 8));
     encodeBuf.AddRange(AddString(OperatorId, 6));
     encodeBuf.AddRange(AddString(ShiftId.PadLeft(10, '0'), 10));
     encodeBuf.AddRange(AddString(SerialNo.PadLeft(4, '0'), 4));
     encodeBuf.AddRange(AddString(AdminType, 2));
     encodeBuf.AddRange(AddString(IncomeFlag.PadLeft(2, '0'), 2));
     encodeBuf.AddRange(AddString(StationId, 4));
     encodeBuf.AddRange(AddString(DessesionAmt.PadLeft(8, '0'), 8));
     encodeBuf.AddRange(AddString(RelateDeviceId, 8));
     encodeBuf.AddRange(AddString(RelateTicketType.PadLeft(16, '0'), 16));
     encodeBuf.AddRange(AddString(SaleOutBoundTicketAmt.PadLeft(8, '0'), 8));
     encodeBuf.AddRange(AddString(RelateOutBoundTicketSerialNo.PadLeft(8, '0'), 10));
     encodeBuf.AddRange(AddString(OutBoundTicketType, 1));
     encodeBuf.AddRange(AddString(TxnTime, 14));
     encodeBuf.AddRange(AddString(Spare.PadLeft(17, '0'), 17));
 }
コード例 #11
0
ファイル: ShiftFeatures.cs プロジェクト: cjjohansen/BDDXunit
        public void can_approve_shift()
        {
            var shiftId1   = new ShiftId(19);
            var localDate1 = new LocalDate(2018, 3, 21);

            var shiftId2   = new ShiftId(20);
            var localDate2 = new LocalDate(2018, 3, 22);

            var fixture = new Fixture();

            fixture.Register(() => shiftId1);
            fixture.Register(() => localDate1);
            var shift = fixture.Create <Shift>();

            fixture.Register(() => shiftId2);
            fixture.Register(() => localDate2);
            var shift2 = fixture.Create <Shift>();

            shift.Id.Should().Be(shiftId1);
            shift.OpeningDate.Should().Be(localDate1);
            shift2.Id.Should().Be(shiftId2);
            shift2.OpeningDate.Should().Be(localDate2);
        }
コード例 #12
0
 public override void Encode()
 {
     encodeBuf.Clear();
     encodeBuf.AddRange(AddString(DeviceId, 8));
     encodeBuf.AddRange(AddString(TxnGroupNumber.PadLeft(2, '0'), 2));
     encodeBuf.AddRange(AddString(SerialNumber.PadLeft(8, '0'), 8));
     encodeBuf.AddRange(AddString(StationId, 4));
     encodeBuf.AddRange(AddString(TxnType, 2));
     encodeBuf.AddRange(AddString(TicketMainType, 2));
     encodeBuf.AddRange(AddString(TicketSubType, 2));
     encodeBuf.AddRange(AddString(TicketPriceCode, 2));
     encodeBuf.AddRange(AddString(SamCardNumber, 8));
     encodeBuf.AddRange(AddString(TicketLogicalId.PadLeft(16, '0'), 16));
     encodeBuf.AddRange(AddString(TicketWriteCouter.PadLeft(6, '0'), 6));
     encodeBuf.AddRange(AddString(ThisTicketOperateAmt.PadLeft(8, '0'), 8));
     encodeBuf.AddRange(AddString(TicketRemainAmt.PadLeft(8, '0'), 8));
     encodeBuf.AddRange(AddString(TxnTime, 14));
     encodeBuf.AddRange(AddString(LastTxnDeviceId, 8));
     encodeBuf.AddRange(AddString(LastTxnSerialNumber.PadLeft(8, '0'), 8));
     encodeBuf.AddRange(AddString(LastTxnAmt.PadLeft(8, '0'), 8));
     encodeBuf.AddRange(AddString(LastTxnTime, 14));
     encodeBuf.AddRange(AddString(TACCode, 8));
     encodeBuf.AddRange(AddString(PaymentType, 1));
     encodeBuf.AddRange(AddString(PaymentCardId, 16));
     encodeBuf.AddRange(AddString(DestinationStationId, 4));
     encodeBuf.AddRange(AddString(TxReasonCode, 3));
     encodeBuf.AddRange(AddString(DegradeMode, 4));
     encodeBuf.AddRange(AddString(TxTotalaAmt.PadLeft(8, '0'), 8));
     encodeBuf.AddRange(AddString(TicketDeposite.PadLeft(8, '0'), 8));
     encodeBuf.AddRange(AddString(TxProcessingFee.PadLeft(8, '0'), 8));
     encodeBuf.AddRange(AddString(TicketValidDate.PadLeft(8, '0'), 8));
     encodeBuf.AddRange(AddString(LastTicketValidDate.PadLeft(8, '0'), 8));
     encodeBuf.AddRange(AddString(OperatorId, 6));
     encodeBuf.AddRange(AddString(ShiftId.PadLeft(10, '0'), 10));
     encodeBuf.AddRange(AddString(Spare.PadLeft(20, '0'), 20));
 }
コード例 #13
0
 public override void Encode()
 {
     encodeBuf.Clear();
     encodeBuf.AddRange(AddString(DeviceId, 8));
     encodeBuf.AddRange(AddString(TxnGroupNumber.PadLeft(2, '0'), 2));
     encodeBuf.AddRange(AddString(SerialNumber.PadLeft(8, '0'), 8));
     encodeBuf.AddRange(AddString(StationId, 4));
     encodeBuf.AddRange(AddString(TxnType, 2));
     encodeBuf.AddRange(AddString(EntryStationId, 4));
     encodeBuf.AddRange(AddString(TicketPriceCode, 2));
     encodeBuf.AddRange(AddString(DegradeMode, 4));
     encodeBuf.AddRange(AddString(TxnTotalAmt.PadLeft(8, '0'), 8));
     encodeBuf.AddRange(AddString(PayCode, 1));
     encodeBuf.AddRange(AddString(TicketDepositAmt.PadLeft(8, '0'), 8));
     encodeBuf.AddRange(AddString(TxnProcessingFee.PadLeft(8, '0'), 8));
     encodeBuf.AddRange(AddString(TxnReasonCode, 3));
     encodeBuf.AddRange(AddString(OperatorId, 6));
     encodeBuf.AddRange(AddString(ShiftId.PadLeft(10, '0'), 10));
     encodeBuf.AddRange(AddString(PurseFlag, 1));
     encodeBuf.AddRange(AddString(Spare, 1));
     //一卡通数据 tab 分割
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(TerminalId, 16));
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(TerminalFlag, 1));
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(TxnTime, 14));
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(TerminalSerialNumber.PadLeft(8, '0'), 8));
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(TicketLogicalId, 16));
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(TicketPhysicalId, 8));
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(TicketMainType, 2));
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(TicketSubType, 2));
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(LastTerminalId, 16));
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(LastTxnTime, 14));
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(TxnAmt.PadLeft(8, '0'), 8));
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(RemainAmt.PadLeft(8, '0'), 8));
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(TxnAndPayType, 2));
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(ThisEntryTerminalId, 16));
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(ThisEntryDateTime, 14));
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(TicketOnlineCounter.PadLeft(6, '0'), 6));
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(TicketOfflineCounter.PadLeft(6, '0'), 6));
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(TACCode, 8));
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(TestFlag, 1));
     encodeBuf.AddRange(AddString("\t", 1));
     encodeBuf.AddRange(AddString(YKTSpare.PadLeft(16, '0'), 16));
 }
コード例 #14
0
ファイル: ShiftApproved.cs プロジェクト: cjjohansen/BDDXunit
 public ShiftApproved(ShiftId id)
 {
     AggregateId = id;
 }
コード例 #15
0
ファイル: Shift.cs プロジェクト: bogdaner2/transports
 public override string ToString()
 {
     return(ShiftId.ToString());
 }
コード例 #16
0
ファイル: ShiftIdArg.cs プロジェクト: cjjohansen/BDDXunit
 public ShiftIdArg(ShiftId value)
 {
     this.value = value;
 }