Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save stijnmoreels/61b4703d27da479083d628ecc48977c7 to your computer and use it in GitHub Desktop.

Select an option

Save stijnmoreels/61b4703d27da479083d628ecc48977c7 to your computer and use it in GitHub Desktop.
[Fact]
public void Potato_Grows()
{
var plantProvider = new PlantProvider(Logger);
PlantType plantType = plantProvider.GetPlantType(PlantType.Potato);
var context = PlantTestContext.Given(plantType);
var soilRepository = new SoilRepository(context.Configuration, Logger);
var drySoil = soilRepository.GetSoil(SoleType.Sandy);
var waterMachine = new WaterSprinkler(context.Configuration, Logger);
var wetSoil = waterMachine.Water(soil, frequency: TimeSpan.FromDays(1));
var growMachine = new PlantGrow(plantType);
PlantResult plantResult = growMachine.GrowIn(wetSoil);
Assert.True(plantResult.Roots.Count > 0, "Should have roots");
Assert.True(plantResult.Vegetable.HasValue, "Should have vegetable");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment