public string GetTriangleSetSummary(ITriangleSet triangleSet)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(triangleSet.EarlyestOriginYearForAllTriangles + ", ");
            sb.Append(triangleSet.DevelopmentYearRange + "\n");

            foreach (var triangle in triangleSet.TriangleDictionary.Values)
            {
                sb.Append(triangle.ProductName + ", ");

                for (int i = triangleSet.EarlyestOriginYearForAllTriangles;
                    i <= triangleSet.LatestOriginYearForAllTriangles;
                    i++)
                {
                    for (int j = 0; j < triangleSet.DevelopmentYearRange; j++)
                    {
                        var oYear = i;
                        var dYear = j + triangleSet.EarlyestDevelopmentYearForAllTriangles;
                        if (oYear <= dYear)
                        {
                            sb.Append(triangle.GetCumulativeValue(oYear, dYear) + ", ");
                        }
                    }
                }
                sb.Remove(sb.Length-2, 1);

                sb.AppendLine();
            }
            sb.Append("\n\n");
            return sb.ToString();
        }
        public CsvTriangleSource(string fileLocation)
        {

            if (!File.Exists(fileLocation))
            {
                throw new FileNotFoundException("Input file not found: " + fileLocation + " Please edit TowersWatsonTriangles.exe.config");
            }

            var csvRows = ParseCsv(fileLocation);

            _triangleSet = new TriangleSet(BuildTriangles(csvRows));

        }
        public void PutTriangles(ITriangleSet triangleSet)
        {
            var result = _summarisationStrategy.GetTriangleSetSummary(triangleSet);

            File.AppendAllText(_fileLocation, result);
        }
 public void PutTriangles(ITriangleSet triangleSet)
 {
     var result = _summarisationStrategy.GetTriangleSetSummary(triangleSet);
     
     Debug.WriteLine(result);
 }