Пример #1
0
        public void CorrectedQTCalculationTest_MoreError()
        {
            // arrange
            var modelMore = new CorrectedQTCalculationQuery
            {
                HeartRate  = 1000,
                IntervalQT = 1000
            };

            // act
            var handler    = new CorrectedQTCalculationHandler();
            var errorModel = handler.Handle(modelMore).Exception.GetErrorListResponseFromException();

            // assert
            Assert.IsTrue(errorModel != null);
            Assert.IsTrue(errorModel.Errors.Count == 2);
            Assert.IsTrue(errorModel.Errors.Contains(CorrectedQTCalculationQueryValidator.HeartRateIncorrectMessage));
            Assert.IsTrue(errorModel.Errors.Contains(CorrectedQTCalculationQueryValidator.IntervalQTIncorrectMessage));
        }
Пример #2
0
        public void CorrectedQTCalculationTest_NotError()
        {
            // arrange
            var res = new CorrectedQTCalculationQuery
            {
                HeartRate  = 50,
                IntervalQT = 30
            };


            // act
            var handler = new CorrectedQTCalculationHandler();
            var result  = handler.Handle(res).Result;

            // assert
            Assert.AreEqual(-0.79999999999999361, result.Framingham);
            Assert.AreEqual(27.386127875258307, result.Bazett);
            Assert.AreEqual(28.231080866430851, result.Fridericia);
            Assert.AreEqual(1.2, result.IntervalRR);
            Assert.AreEqual(12.5, result.Hodges);
        }
Пример #3
0
 public async Task <CorrectedQTCalculationResponse> CalculateCorrectedQTCalculation(CorrectedQTCalculationQuery query)
 {
     return(await _сorrectedQTCalculationHandler.Handle(query));
 }