示例#1
0
 public void CalculateCameraParameters_ThrowArgumentEx_When_DistanceToObject_IsNull()
 {
     Assert.Throws(typeof(ArgumentException), () =>
     {
         _distanceCalculationService.CalculateCameraParameters(new DistanceToDevice(350), null,
                                                               CalculationMode.CalculateOnly);
     });
 }
        public CalculationEntry Post([FromBody] CalculationRequestDto dto)
        {
            var calculationMethod = dto.SaveToDatabase ? CalculationMode.WithSave : CalculationMode.CalculateOnly;

            return(_distanceCalculationService.CalculateCameraParameters(new DistanceToDevice(dto.DistanceToCamera),
                                                                         new DistanceToObject(dto.DistanceToObject), calculationMethod));
        }