Exemple #1
0
        public void GivenDistanceOf0_ThrowInvalidOperationException()
        {
            #region Arrange

            #endregion

            #region Act

            var distanceOrError = RunDistance.Create(0);

            #endregion

            #region Assert

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

            #endregion
        }
Exemple #2
0
        public void WhenDistanceGreaterThan0_ReturnValidRunDistance()
        {
            #region Arrange

            const int distance = 10;

            #endregion

            #region Act

            var result      = RunDistance.Create(distance);
            var runDistance = result.Value;

            #endregion

            #region Assert

            runDistance.Value.Should().Be(distance);

            #endregion
        }
Exemple #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")
         }
     };
 }