public void DogIsInOverweight_IfBreedIsBoxerAndWeightIs50()
        {
            var service = new DogMeasuresService(_mockRepository.Object);
            var result  = service.CheckDogIdealWeight("bóxer", 50);

            Assert.IsTrue(result.DeviationType == Models.DogWeightInfo.WeightDeviationType.Overweight);
        }
Esempio n. 2
0
 public async Task <IActionResult> Index([FromForm] DogInfoRequest info)
 {
     if (!ModelState.IsValid)
     {
         return(View(info));
     }
     try
     {
         var measures = new DogMeasuresService().CheckDogIdealWeight(info.Breed, info.Weight);
         return(await Task.FromResult(View("MeasuresResults", measures)));
     }
     catch (Exception ex)
     {
         ModelState.AddModelError("", $"Error al obtener la información sobre tu perro: {ex.Message}.");
         return(View(info));
     }
 }
Esempio n. 3
0
 public static void Setup(TestContext context)
 {
     _dogMeasuresService = new DogMeasuresService(new DogMeasuresRepository());
 }
 public DogMeasuresServiceShould()
 {
     _dogMeasuresService = new DogMeasuresService(new DogMeasuresRepository());
 }
 public DogMeasuresServiceShould()
 {
     _dogMeasuresService = new DogMeasuresService();
 }
 public void Setup()
 {
     _dogMeasuresService = new DogMeasuresService(new DogMeasuresRepository());
 }
Esempio n. 7
0
 public static void Setup(TestContext context)
 {
     _dogMeasuresService = new DogMeasuresService();
 }
 public void Setup()
 {
     _dogMeasuresService = new DogMeasuresService();
 }
Esempio n. 9
0
 public void ThrowsBreedNotFoundException_IfBreedIsYorkshire()
 {
     var service = new DogMeasuresService(new FakeDogMeasuresRepository());
     var result  = service.CheckDogIdealWeight("yorkshire", 14);
 }
 public void ThrowsArgumentOutOfRangeException_IfWeightIsNegative()
 {
     var service = new DogMeasuresService();
     var result  = service.CheckDogIdealWeight("labrador retriever", -5);
 }