public void ShouldParseResponseMessage() { Pharmacy expectedPharmacy = new Pharmacy() { AddressLine1 = "TEST Street", AddressLine2 = "ETC", City = "Victoria", CountryCode = "CA", Name = "Gateway", PharmacyId = "123456", PhoneNumber = "2500008888", PostalCode = "V0V0X0", Province = "BC" }; string dateTime = this.getDateTime().ToString("yyyy/MM/dd HH:mm:ss", this.culture); string date = this.getDateTime().ToString("yyMMdd", this.culture); StringBuilder sb = new StringBuilder(); sb.Append($"MSH|^~\\&|{hnClientConfig.SendingApplication}|{hnClientConfig.SendingFacility}|{hnClientConfig.ReceivingApplication}|{hnClientConfig.ReceivingFacility}|{dateTime}|{userId}:{ipAddress}|ZPN|{traceNumber}|{hnClientConfig.ProcessingID}|{hnClientConfig.MessageVersion}\r"); sb.Append($"ZCB|BCXXZZZYYY|{date}|{traceNumber}\r"); // ZPL pharmacy info sb.Append("ZPL|"); sb.Append($"{expectedPharmacy.PharmacyId}|"); sb.Append($"{expectedPharmacy.Name}||"); sb.Append($"{expectedPharmacy.AddressLine1}|"); sb.Append($"{expectedPharmacy.AddressLine2}|"); sb.Append($"{expectedPharmacy.City}|"); sb.Append($"{expectedPharmacy.Province}|"); sb.Append($"{expectedPharmacy.PostalCode}|"); sb.Append($"{expectedPharmacy.CountryCode}|||"); sb.Append($"{expectedPharmacy.PhoneNumber.Substring(0, 3)}|"); sb.Append($"{expectedPharmacy.PhoneNumber.Substring(3, 7)}|||"); sb.Append($"{expectedPharmacy.PharmacyId}|\r"); sb.Append($"ZZZ|TRP|0|{traceNumber}|{hnClientConfig.ZZZ.PractitionerIdRef}|{hnClientConfig.ZZZ.PractitionerId}||0 Operation successful\r"); List <Pharmacy> pharmacies = this.parser.ParseResponseMessage(sb.ToString()); Assert.Single(pharmacies); Assert.True(expectedPharmacy.IsDeepEqual(pharmacies.First())); }