public void RightLengthForSmallChild()
        {
            const int age        = 4;
            const int bodyLength = 105;
            var       length     = SkiLengthCalculator.CalculateLengthChild(age, bodyLength);

            Assert.AreEqual(bodyLength, length);
        }
        public void RightLengthForAdultFreestyle()
        {
            const int bodyLength = 170;
            const SkiLengthCalculator.SkiType type = SkiLengthCalculator.SkiType.Freestyle;
            var length = SkiLengthCalculator.CalculateLengthAdult(bodyLength, type);

            Assert.True(length >= bodyLength + 10 && length <= bodyLength + 15);
        }
        public void MaxLengthForAdultClassic()
        {
            const int bodyLength = 200;
            const SkiLengthCalculator.SkiType type = SkiLengthCalculator.SkiType.Classic;
            var length = SkiLengthCalculator.CalculateLengthAdult(bodyLength, type);

            Assert.AreEqual(207, length);
        }
        public void RightLengthForAdultClassic()
        {
            const int bodyLength = 170;
            const SkiLengthCalculator.SkiType type = SkiLengthCalculator.SkiType.Classic;
            var length = SkiLengthCalculator.CalculateLengthAdult(bodyLength, type);

            Assert.AreEqual(bodyLength + 20, length);
        }
        public void RightLengthForOlderChild()
        {
            const int age        = 8;
            const int bodyLength = 130;
            var       length     = SkiLengthCalculator.CalculateLengthChild(age, bodyLength);

            Assert.True(length >= bodyLength + 10 && length <= bodyLength + 20);
        }
        private static void TestWithParameters(int age, int length, SkiStyle skistyle,
                                               int expectedSkiLengthMin, int expectedSkiLengthMax, string expectedComment)
        {
            var result = new SkiLengthCalculator().Calculate(age, length, skistyle);

            Assert.Equal(expectedSkiLengthMin, result.SkiLength.Min);
            Assert.Equal(expectedSkiLengthMax, result.SkiLength.Max);
            Assert.Equal(expectedComment, result.Comment);
        }
Beispiel #7
0
 public int GetSkiLengthFreestyle(int bodyLength)
 {
     return(SkiLengthCalculator.CalculateLengthAdult(bodyLength, SkiLengthCalculator.SkiType.Freestyle));
 }
Beispiel #8
0
 public int GetSkiLengthClassic(int bodyLength)
 {
     return(SkiLengthCalculator.CalculateLengthAdult(bodyLength, SkiLengthCalculator.SkiType.Classic));
 }
Beispiel #9
0
 public int GetSkiLengthChild(int age, int bodyLength)
 {
     return(SkiLengthCalculator.CalculateLengthChild(age, bodyLength));
 }
 public void Init()
 {
     _sut = new SkiLengthCalculator();
 }