コード例 #1
0
        public FunctionSquaredReturn ShowSquaredSumResult(List <int> numbers)
        {
            var result = functionSquaredSum.SumOfSquared(numbers);
            FunctionSquaredReturn functionSquaredReturn = new FunctionSquaredReturn()
            {
                numbers       = numbers,
                returnedValue = result
            };

            return(functionSquaredReturn);
        }
コード例 #2
0
        public void WhenCall_SumOfSquared_PassingAGivenListOfIntegers_ShouldReturnSquaredSum()
        {
            FunctionSquaredSum func = new FunctionSquaredSum();
            var numbersList         = new List <int>();

            numbersList.Add(1);
            numbersList.Add(2);
            numbersList.Add(3);
            numbersList.Add(4);
            numbersList.Add(5);

            var returnedValue = func.SumOfSquared(numbersList);

            Assert.AreEqual(55, returnedValue);
        }