Ejemplo n.º 1
0
 private static void ParseAddress(string sourcePath, string destinationPath)
 {
     using (var input = System.IO.File.OpenRead(sourcePath)) {
         using (var output = System.IO.File.OpenWrite(destinationPath)) {
             CustomerAddressParser.Parse(input, output);
         }
     }
 }
Ejemplo n.º 2
0
        public void ParseAddress()
        {
            string[] result = null;

            using (var output = new MemoryStream()) {
                using (var input = MockCustomerData.Stream) {
                    CustomerAddressParser.Parse(input, output);
                }

                result = UTF8.GetString(output.ToArray()).Split('\n');
            }

            Equal(5, result.Length);
            Equal("65 Ambling Way", result[0]);
            Equal("8 Crimson Rd", result[1]);
            Equal("102 Long Lane", result[2]);
            Equal("94 Roland St", result[3]);
            Equal(string.Empty, result[4]);
        }