public void CanStreamEnumerables() { string xml = Scenario1.Xml; Validate(action: () => XmlStreamer.StreamInstances <EnumerableSets>(xml)); Debug.WriteLine(xml); }
public void CanStreamOutIEnumerablesUsingStandardDeserialization() { var file = new FileInfo(testFiles.First(fileName => fileName.Contains("Town.xml"))); var streamer = new XmlStreamer(file); var result = streamer.StreamInstances <Town>(); Assert.NotNull(result); //result.Dump(); }
public void CanStreamOutArrayOfStrings() { var file = new FileInfo(testFiles.First(fileName => fileName.Contains("Details.xml"))); var streamer = new XmlStreamer(file); var details = streamer.StreamInstances <ScenarioDetails>(); Assert.NotNull(details); //details.Dump("scenario details"); }
public void HappyPathTest() { string fileName = "Keyboards.xml"; string xml = ""; var keyboard = XmlStreamer.StreamInstances <Keyboard>(xml).First(); Debug.WriteLine(keyboard.Name); Debug.WriteLine(keyboard.Price); Assert.NotNull(keyboard); }
static IEnumerable <Store> StreamFromString() { string filePath = "Stores.xml"; string xml = ""; var stores = XmlStreamer.StreamInstances <Store>(xml); foreach (var store in stores) { Debug.WriteLine(store?.ToString()); } Debug.WriteLine(stores.Count()); return(stores); }
IEnumerable <Store> StreamFromFile() { //Assemble string xmlFilePath = testFiles.First(fileName => fileName.Contains("Store.xml")); var xmlStreamer = new XmlStreamer(xmlFilePath); //Act IEnumerable <Store> stores = xmlStreamer.StreamInstances <Store>(); //Assert: Assert.NotNull(stores); Assert.True(stores.Any()); Debug.WriteLine(stores.Count()); return(stores); }