public void ParseResults_ValidJson_ExpectedResults() { // Arrange var sut = new WeppV3_1(); string json = File.ReadAllText( @"Assets\exampleWeppResultV3_1.json"); // Act WeppResponseV3_1 actual = sut.ParseResultsJson(json); // Assert Assert.Equal(0.002899999963119626, actual.SoilLoss); Assert.Equal("Transition_NoTill", actual.RotationName); Assert.Equal("8af8f7ab-064a-11ea-a464-7b605541b058", actual.Suid); }
public List <WeppResponseV3_1> ReadWeppResponseV3_1Files( string filePath, WeppV3_1 service) { string[] files = Directory.GetFiles(filePath, "*.json"); List <WeppResponseV3_1> results = new List <WeppResponseV3_1>(); foreach (var file in files) { string json = File.ReadAllText(file); WeppResponseV3_1 result = service.ParseResultsJson(json); results.Add(result); } return(results); }