public void can_split_file() { string contents = "ISA~00~ ~00~ ~ZZ~FEDEXCADS ~01~1109518 ~" + "050620~1031~U~00401~000064170~0~P~^/" + "GS~PO~CADS~1109518C~20050620~1031~55323~X~004010/ST~850~553230001/" + "BEG~00~NE~C04134707~~20050620/" + "REF~I5~OR/REF~19~001/REF~ZZ~CAD33/REF~XE~5/" + "PER~DC~JENNIFER WILLIAMS/" + "N1~ST~EPS SETTLEMENTS GROUP~92~SUSA/N3~12825 FLUSHING MEADOWS DR FL 2~STE 280/" + "N4~SAINT LOUIS~MO~63131~US/" + "PO1~1~4~PK~0~~IN~146525~VN~146525~PD~LABEL, FEDEX SHIP F223 100-PK, 8PK-BX 112BX-P~TP~U/" + "REF~CO~256070251719847/REF~BF~256070/" + "SCH~4~PK~~~002~20050620/" + "PO1~2~1~EA~6.75~~IN~CAD33~VN~CAD33~PD~FEE, SERVICE FOR CUSTOMER SUPPLY ORDER~TP~S/" + "REF~CO~256070251719847/REF~BF~256070/" + "SCH~1~EA~~~002~20050620/SE~19~553230001/GE~1~55323/IEA~1~000064170~"; var order = new DocumentRecordPackage(new OrderRequestReceivedMessage(),null,null); var splitter = new SegmentSplitter(); var isa_lst_lst = new List<InterchangeContainer>(); _documentParser.Setup(p => p.ProcessSegmentList(It.IsAny<List<Segment>>())).Returns(order); var segs = splitter.Split(contents); _sut.Parse(segs); _splitter.VerifyAll(); }
public void can_split_file() { string contents = @"ISA*00* *00* *ZZ*SPSMICROELEC *12*EEC5122516063 *120626*1504*U*00401*100000001*0*P*}~GS*PO*SPSMICROELEC*EEC5122516063*20120626*1504*1001*X*004010~ST*850*1001~BEG*00*SA*25151**20120625~REF*IA*25097~PER*IC*MICHELE WALTERS*TE*000000000000000~CSH*N~DTM*010*20120701~DTM*002*20120709~DTM*001*20120725~N9*L1**PO Notes~MSG*DON CHUTES 614-527-7853~MSG*[email protected]~MSG*CELL - 614 204 3179~MSG*EDI~N1*ST*MEI/MICRO CENTER, INC.*92*033~N3*#033 IPSG FINISHED PRODUCTS*2701 CHARTER ST. SUITE A~N4*COLUMBUS*OH*43228~PO1*001*1500*EA*2.03**VP*UNIV OUTER BOX*BP*0000060434~CTP**MSR*2.09~PID*F****POWERSPEC UNIV OUTER BOX~PO1*002*1500*EA*0.36**VP*UNIV ACCES BOX*BP*0000060467~CTP**MSR*0.37~PID*F****POWERSPEC UNIV ACCES BOX~PO1*003*1500*EA*4.12**VP*UNIV FOAM SET*BP*0000060483~CTP**MSR*4.24~PID*F****POWERSPEC UNIV FOAM SET~CTT*3~SE*27*1001~GE*1*1001~IEA*1*100000001~"; var order = new DocumentRecordPackage(new OrderRequestReceivedMessage(),null,null); var splitter = new SegmentSplitter(); var isa_lst_lst = new List<InterchangeContainer>(); _documentParser.Setup(p => p.ProcessSegmentList(It.IsAny<List<Segment>>())).Returns(order); var segs = splitter.Split(contents); _sut.Parse(segs); _splitter.VerifyAll(); }
public void can_count_segments() { //ARRANGE string contents = @"ISA*00* *00* *ZZ*SPSMICROELEC *12*EEC5122516063 *120626*1504*U*00401*100000001*0*P*}~GS*PO*SPSMICROELEC*EEC5122516063*20120626*1504*1001*X*004010~ST*850*1001~BEG*00*SA*25151**20120625~REF*IA*25097~PER*IC*MICHELE WALTERS*TE*000000000000000~CSH*N~DTM*010*20120701~DTM*002*20120709~DTM*001*20120725~N9*L1**PO Notes~MSG*DON CHUTES 614-527-7853~MSG*[email protected]~MSG*CELL - 614 204 3179~MSG*EDI~N1*ST*MEI/MICRO CENTER, INC.*92*033~N3*#033 IPSG FINISHED PRODUCTS*2701 CHARTER ST. SUITE A~N4*COLUMBUS*OH*43228~PO1*001*1500*EA*2.03**VP*UNIV OUTER BOX*BP*0000060434~CTP**MSR*2.09~PID*F****POWERSPEC UNIV OUTER BOX~PO1*002*1500*EA*0.36**VP*UNIV ACCES BOX*BP*0000060467~CTP**MSR*0.37~PID*F****POWERSPEC UNIV ACCES BOX~PO1*003*1500*EA*4.12**VP*UNIV FOAM SET*BP*0000060483~CTP**MSR*4.24~PID*F****POWERSPEC UNIV FOAM SET~CTT*3~SE*27*1001~GE*1*1001~IEA*1*100000001~"; var splitter = new SegmentSplitter(); var segmentList = splitter.Split(contents).SegmentList.ToList(); segmentList = segmentList.GetRange(2, 27); //ACT _sut.ProcessSegmentList(segmentList); //ASSERT Assert.That(segmentList.Count, Is.EqualTo(0)); }