示例#1
0
        public void FindPythagoreanTripletTotallingN_3_EmptyList()
        {
            var expected = new List <int>();
            var actual   = P009.FindPythagoreanTripletTotallingN(3);

            Assert.AreEqual(expected, actual);
        }
示例#2
0
        public void IsPythagoreanTriplet_3_4_6()
        {
            var expected = false;
            var actual   = P009.IsPythagoreanTriplet(3, 4, 6);

            Assert.AreEqual(expected, actual);
        }
示例#3
0
        public void IsPythagoreanTriplet_3_4_5()
        {
            var expected = true;
            var actual   = P009.IsPythagoreanTriplet(3, 4, 5);

            Assert.AreEqual(expected, actual);
        }
示例#4
0
        public void FindPythagoreanTripletTotallingN_1000_Result()
        {
            var expected = new List <int>()
            {
                200, 375, 425
            };
            var actual = P009.FindPythagoreanTripletTotallingN(1000);

            var product = 1;

            actual.ForEach(x => product *= x);
            Assert.AreEqual(expected, actual);
        }