public void RunToleratedAmbientPressureStage(double[] mockTissuePressuresTotal, double[] mockAValues,
                                                     double[] mockBValues, double[] toleratedAmbientPressuresResult)
        {
            _diveProfile = DiveProfileHelper.InitaliseDiveProfile();

            _diveProfile.TissuePressuresTotal = new List <double>(mockTissuePressuresTotal);
            _diveProfile.AValues = new List <double>(mockAValues);
            _diveProfile.BValues = new List <double>(mockBValues);

            var diveStage = new DiveStageToleratedAmbientPressure(_diveModel.CompartmentCount, _diveProfile);

            //Act
            for (int i = 0; i < _diveModel.CompartmentCount; i++)
            {
                diveStage.RunStage();

                //Assert
                Assert.Equal(toleratedAmbientPressuresResult[i], _diveProfile.ToleratedAmbientPressures[i], 4);
            }
        }
Esempio n. 2
0
        public void RunCompartmentLoadStage(double[] mockTissuePressuresTotal, double[] mockMaxSurfacePressure,
                                            double[] compartmentLoadResult)
        {
            //Arrange
            _diveProfile = DiveProfileHelper.InitaliseDiveProfile();

            _diveProfile.TissuePressuresTotal = new List <double>(mockTissuePressuresTotal);
            _diveProfile.MaxSurfacePressures  = new List <double>(mockMaxSurfacePressure);

            var diveStage = new DiveStageCompartmentLoad(_diveModel, _diveProfile);

            //Act
            for (int i = 0; i < _diveModel.CompartmentCount; i++)
            {
                diveStage.RunStage();

                //Assert
                Assert.Equal(compartmentLoadResult[i], _diveProfile.CompartmentLoad[i], 4);
            }
        }
Esempio n. 3
0
        public void RunMaximumSurfacePressureStage(double[] mockAValues, double[] mockBValues,
                                                   double[] maxSurfacePressureResult)
        {
            //Arrange
            _diveProfile = DiveProfileHelper.InitaliseDiveProfile();

            _diveProfile.AValues = new List <double>(mockAValues);
            _diveProfile.BValues = new List <double>(mockBValues);

            var diveStage = new DiveStageMaximumSurfacePressure(_diveModel.CompartmentCount, _diveProfile);

            //Act
            for (int i = 0; i < _diveModel.CompartmentCount; i++)
            {
                diveStage.RunStage();

                //Assert
                Assert.Equal(maxSurfacePressureResult[i], _diveProfile.MaxSurfacePressures[i], 4);
            }
        }
Esempio n. 4
0
        public void RunAbValuesStage(double[] mockTissuePressureNitrogen, double[] mockTissuePressureHelium,
                                     double[] mockTissuePressureTotal, double[] aValueResult, double[] bValueResult)
        {
            //Arrange
            _diveProfile = DiveProfileHelper.InitaliseDiveProfile();

            _diveProfile.TissuePressuresNitrogen = new List <double>(mockTissuePressureNitrogen);
            _diveProfile.TissuePressuresHelium   = new List <double>(mockTissuePressureHelium);
            _diveProfile.TissuePressuresTotal    = new List <double>(mockTissuePressureTotal);

            var diveStage = new DiveStageAbValues(_diveModel, _diveProfile);

            //Act
            for (int i = 0; i < _diveModel.CompartmentCount; i++)
            {
                diveStage.RunStage();

                //Assert
                Assert.Equal(aValueResult[i], _diveProfile.AValues[i], 4);
                Assert.Equal(bValueResult[i], _diveProfile.BValues[i], 4);
            }
        }
        public void RunTissuePressureStage(double[] mockTissuePressuresNitrogen, double[] mockTissuePressuresHelium,
                                           double[] mockTissuePressuresTotal, int bottomTime, double[] tissuePressureNitrogenResult,
                                           double[] tissuePressureHeliumResult, double[] tissuePressureTotalResult)
        {
            DiveProfileHelper.InitaliseDiveProfile();

            _diveProfile.TissuePressuresNitrogen = new List <double>(mockTissuePressuresNitrogen);
            _diveProfile.TissuePressuresHelium   = new List <double>(mockTissuePressuresHelium);
            _diveProfile.TissuePressuresTotal    = new List <double>(mockTissuePressuresTotal);

            var diveStage = new DiveStageTissuePressure(_diveModel, _diveProfile, bottomTime);


            //Act
            for (int i = 0; i < _diveModel.CompartmentCount; i++)
            {
                diveStage.RunStage();

                //Assert
                Assert.Equal(tissuePressureNitrogenResult[i], _diveProfile.TissuePressuresNitrogen[i], 2);
                Assert.Equal(tissuePressureHeliumResult[i], _diveProfile.TissuePressuresHelium[i], 2);
                Assert.Equal(tissuePressureTotalResult[i], _diveProfile.TissuePressuresTotal[i], 2);
            }
        }