コード例 #1
0
    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);
    }
コード例 #2
0
 public RouteController(Denormolizer denormolizer)
 {
     _denormolizer = denormolizer;
 }