public void Test() { // Arrange var denormolizer = new Denormolizer(); string inputString; using (var reader = new StreamReader("RestAPI_JSON_Input.json")) inputString =reader.ReadToEnd(); var input = JsonConvert.DeserializeObject<List<Route>>(inputString); string outputString; using (var reader = new StreamReader("RestAPI_JSON_Output.json")) outputString = reader.ReadToEnd(); var output = JsonConvert.DeserializeObject<List<DenormolizeRoute>>(outputString); // Act var result = input.SelectMany(item => denormolizer.Invoke(item)).ToList(); // Assert Assert.Equal(output, result); }
public ActionResult Post(List <Route> routes) { return(Ok(routes.SelectMany(route => _denormolizer.Invoke(route)).ToList())); }