Exemplo n.º 1
0
        public void TakeOffReportShouldHaveAssumedTemp()
        {
            var p = GetParameters();
            var t = LoaderTest.GetTable();

            var r = Calculator.TakeOffReport(t, p);
            // Should not throw
        }
Exemplo n.º 2
0
        public void HasMatchingFlaps()
        {
            var p = GetParameters();
            var t = LoaderTest.GetTable();

            var d = Calculator.TakeOffDistanceMeter(t, p);
            // Should not throw.
        }
Exemplo n.º 3
0
        public void TakeOffReportRunwayTooShort()
        {
            var p = GetParameters();

            p.RwyLengthMeter = 500;
            var t = LoaderTest.GetTable();

            Assert.Throws <RunwayTooShortException>(() => Calculator.TakeOffReport(t, p));
        }
Exemplo n.º 4
0
        public void TakeOffReportFlapsNotFound()
        {
            var p = GetParameters();

            p.FlapsIndex = 1;
            var t = LoaderTest.GetTable();

            Assert.Throws <Exception>(() => Calculator.TakeOffReport(t, p));
        }
Exemplo n.º 5
0
        public void NoMatchingFlaps()
        {
            var p = GetParameters();

            p.FlapsIndex = 1;

            var t = LoaderTest.GetTable();

            Assert.Throws <Exception>(() => Calculator.TakeOffDistanceMeter(t, p));
        }
Exemplo n.º 6
0
        public void Only1TableNoCorrection()
        {
            var p = GetParameters();

            var t = LoaderTest.GetTable();

            t.Tables = t.Tables.Where(x => x.IsaOffset < 1).ToList();

            var d = Calculator.TakeOffDistanceMeter(t, p);

            Assert.AreEqual(5000 * Constants.FtMeterRatio, d, 10);
        }
Exemplo n.º 7
0
        public void TwoTablesIsaOffset()
        {
            var p = GetParameters();

            p.OatCelsius += 7.5;
            p.WeightKg    = (139_000 + 132_000) / 2.0 * Constants.LbKgRatio;

            var t = LoaderTest.GetTable();

            var d = Calculator.TakeOffDistanceMeter(t, p);

            Assert.AreEqual(4000 * Constants.FtMeterRatio, d, 10);
        }
Exemplo n.º 8
0
        public void WetCorrection()
        {
            var p = GetParameters();

            p.WeightKg  -= 2273 * Constants.LbKgRatio;
            p.SurfaceWet = true;

            var t = LoaderTest.GetTable();

            var d = Calculator.TakeOffDistanceMeter(t, p);

            Assert.AreEqual(5000 * Constants.FtMeterRatio, d, 10);
        }
Exemplo n.º 9
0
        public void PacksOnCorrection()
        {
            var p = GetParameters();

            p.WeightKg -= 4888.9 * Constants.LbKgRatio;
            p.PacksOn   = true;

            var t = LoaderTest.GetTable();

            var d = Calculator.TakeOffDistanceMeter(t, p);

            Assert.AreEqual(5000 * Constants.FtMeterRatio, d, 10);
        }
Exemplo n.º 10
0
        public void AllAICorrection()
        {
            var p = GetParameters();

            p.WeightKg -= 1666.7 * Constants.LbKgRatio;
            p.AntiIce   = AntiIceOption.EngAndWing;

            var t = LoaderTest.GetTable();

            var d = Calculator.TakeOffDistanceMeter(t, p);

            Assert.AreEqual(5000 * Constants.FtMeterRatio, d, 10);
        }
Exemplo n.º 11
0
        public void DownhillCorrection()
        {
            var p = GetParameters();

            p.RwySlopePercent = -1.0;
            p.WeightKg        = (139_000 * 80 + 152_000 * 920) / 1000.0 * Constants.LbKgRatio;

            var t = LoaderTest.GetTable();

            var d = Calculator.TakeOffDistanceMeter(t, p);

            Assert.AreEqual((4920 - 55.76) * Constants.FtMeterRatio, d, 10);
        }
Exemplo n.º 12
0
        public void NonZeroAltitude()
        {
            var p = GetParameters();

            p.RwyElevationFt = 2000;
            p.OatCelsius     = 15 - 1.98 * 2;
            p.WeightKg       = 146_000 * Constants.LbKgRatio;

            var t = LoaderTest.GetTable();

            var d = Calculator.TakeOffDistanceMeter(t, p);

            Assert.AreEqual(5000 * Constants.FtMeterRatio, d, 10);
        }
Exemplo n.º 13
0
        public void TailwindCorrection()
        {
            var p = GetParameters();

            p.WindSpeedKnots = 10;
            p.WindHeading    = 180;
            p.WeightKg       = (139_000 * 80 + 152_000 * 920) / 1000.0 * Constants.LbKgRatio;

            var t = LoaderTest.GetTable();

            var d = Calculator.TakeOffDistanceMeter(t, p);

            Assert.AreEqual((4920 + 10 * 74.62) * Constants.FtMeterRatio, d, 10);
        }