Exemplo n.º 1
0
        public void GivenSpeedGreaterThan0_ReturnValidWindSpeed()
        {
            #region Arrange

            var speed = 15;

            #endregion

            #region Act

            var result    = RunWindSpeed.Create(speed);
            var windSpeed = result.Value;

            #endregion

            #region Assert

            windSpeed.Value.Should().Be(speed);

            #endregion
        }
Exemplo n.º 2
0
        public void Given0WindSpeed_ThrowInvalidOperationException()
        {
            #region Arrange

            var speed = 0;

            #endregion

            #region Act

            var windSpeedOrError = RunWindSpeed.Create(speed);

            #endregion

            #region Assert

            windSpeedOrError.Invoking(x => x.Value)
            .Should()
            .Throw <InvalidOperationException>()
            .WithMessage("Wind speed must be greater than 0");

            #endregion
        }
Exemplo n.º 3
0
 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")
         }
     };
 }