public void GivenWaterQuantityGreaterThan0_ReturnValidWaterSupply() { #region Arrange var qty = 4; #endregion #region Act var result = WaterSupply.Create(qty); var waterSupply = result.Value; #endregion #region Assert waterSupply.Value.Should().Be(qty); #endregion }
public void Given0WaterQuantity_ThrowInvalidOperationException() { #region Arrange var qty = 0; #endregion #region Act var waterSupplyOrError = WaterSupply.Create(qty); #endregion #region Assert waterSupplyOrError.Invoking(x => x.Value) .Should() .NotThrow <InvalidOperationException>(); #endregion }
public void GivenNegativeWaterQuantity_ThrowInvalidOperationException() { #region Arrange var qty = -88; #endregion #region Act var waterSupplyOrError = WaterSupply.Create(qty); #endregion #region Assert waterSupplyOrError.Invoking(x => x.Value) .Should() .Throw <InvalidOperationException>() .WithMessage("Water supply cannot be negative"); #endregion }
public InMemoryRunData() { runs = new List <Run>() { new Run { Date = new DateTime(2020, 3, 26), Distance = RunDistance.Create(7.36).Value, Type = RunType.Trail, RunTemperature = new RunTemperature(5), RunWindSpeed = RunWindSpeed.Create(9).Value, Clothes = new Clothes("thin sweater, tight sweater, tight shirt, shorts"), Gear = new Gear(WaterSupply.Create(4.0).Value, new FoodBag { Items = new List <FoodItem> { new FoodItem("guu", 2), new FoodItem("peanut butter sandwich", 1) } }), SatisfactionLevel = SatisfactionLevel.Medium, Notes = new Notes("Great run!") }, new Run { Date = new DateTime(2020, 4, 6), Distance = RunDistance.Create(8.36).Value, Type = RunType.Road, RunTemperature = new RunTemperature(13), RunWindSpeed = RunWindSpeed.Create(16).Value, Clothes = new Clothes("tight shirt, shorts"), Gear = new Gear(WaterSupply.Create(2.0).Value, new FoodBag { Items = new List <FoodItem> { new FoodItem("guu", 2), new FoodItem("peanut butter sandwich", 1) } }), SatisfactionLevel = SatisfactionLevel.Hard, Notes = new Notes("Ok run!") }, new Run { Date = new DateTime(2020, 5, 6), Distance = RunDistance.Create(8.36).Value, Type = RunType.Road, RunTemperature = new RunTemperature(13), RunWindSpeed = RunWindSpeed.Create(16).Value, Clothes = new Clothes("tight shirt, shorts"), Gear = new Gear(WaterSupply.Create(2.0).Value, new FoodBag { Items = new List <FoodItem> { new FoodItem("guu", 2), new FoodItem("peanut butter sandwich", 1) } }), SatisfactionLevel = SatisfactionLevel.Hard, Notes = new Notes("Horrible run") } }; }