public void GivenTheJSonFile_Then_TheFileIsProcessed_AsExpected() { // Arrange var fileContents = File.ReadAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestData/TestJsonFile.json")); // Act var actual = _feedProcessor.Process(fileContents); // Assert Assert.NotNull(actual); Assert.Equal("bphVf_Ik6LkkxYT5aN1MgQvcta0", actual.FeedId); Assert.Single(actual.Races); Assert.Equal(2, actual.Races.First().Horses.Count()); Assert.Equal("Toolatetodelegate", actual.Races.First().Horses.First().Name); Assert.Equal(10m, actual.Races.First().Horses.First().Price); }
public void ShouldDeserializeCorrectly() { // Arrange var fileContents = File.ReadAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestData/TestJson.json")); // Act var actual = _subject.Process(fileContents); // Assert Assert.That(actual, Is.Not.Null); Assert.That(actual.FeedId, Is.EqualTo("bphVf_Ik6LkkxYT5aN1MgQvcta0")); Assert.That(actual.Races.Count(), Is.EqualTo(1)); Assert.That(actual.Races.First().Horses.Count(), Is.EqualTo(2)); Assert.That(actual.Races.First().Horses.First().Name, Is.EqualTo("Toolatetodelegate")); Assert.That(actual.Races.First().Horses.First().Price, Is.EqualTo(10m)); }