Sha256: 2508abb4eda8613c78233c9e2c2d62355a8f434890362aa304a96a15111601f5

Contents?: true

Size: 1023 Bytes

Versions: 86

Compression:

Stored size: 1023 Bytes

Contents

using System;
using System.Linq;
using Generators.Input;
using Newtonsoft.Json.Linq;

namespace Generators.Exercises
{
    public class PascalsTriangle : GeneratorExercise
    {
        protected override void UpdateCanonicalData(CanonicalData canonicalData)
        {
            //remove null case until canonical data is updated
            var cases = canonicalData.Cases.ToList();
            cases.RemoveAll(x => x.Properties["count"] == null);
            canonicalData.Cases = cases.ToArray();

            foreach (var canonicalDataCase in canonicalData.Cases)
            {
                canonicalDataCase.UseVariableForExpected = true;
                canonicalDataCase.Property = "calculate";
                if (!(canonicalDataCase.Expected is JArray))
                    canonicalDataCase.ExceptionThrown = typeof(ArgumentOutOfRangeException);
                if (canonicalDataCase.Properties["count"] == null)
                    canonicalDataCase.Properties["count"] = -1;
            }
        }
    }
}

Version data entries

86 entries across 86 versions & 1 rubygems

Version Path
trackler-2.2.1.151 tracks/csharp/generators/Exercises/PascalsTriangle.cs
trackler-2.2.1.150 tracks/csharp/generators/Exercises/PascalsTriangle.cs
trackler-2.2.1.149 tracks/csharp/generators/Exercises/PascalsTriangle.cs
trackler-2.2.1.148 tracks/csharp/generators/Exercises/PascalsTriangle.cs
trackler-2.2.1.147 tracks/csharp/generators/Exercises/PascalsTriangle.cs
trackler-2.2.1.146 tracks/csharp/generators/Exercises/PascalsTriangle.cs
trackler-2.2.1.145 tracks/csharp/generators/Exercises/PascalsTriangle.cs
trackler-2.2.1.144 tracks/csharp/generators/Exercises/PascalsTriangle.cs
trackler-2.2.1.143 tracks/csharp/generators/Exercises/PascalsTriangle.cs
trackler-2.2.1.142 tracks/csharp/generators/Exercises/PascalsTriangle.cs
trackler-2.2.1.141 tracks/csharp/generators/Exercises/PascalsTriangle.cs
trackler-2.2.1.140 tracks/csharp/generators/Exercises/PascalsTriangle.cs
trackler-2.2.1.139 tracks/csharp/generators/Exercises/PascalsTriangle.cs
trackler-2.2.1.138 tracks/csharp/generators/Exercises/PascalsTriangle.cs
trackler-2.2.1.137 tracks/csharp/generators/Exercises/PascalsTriangle.cs
trackler-2.2.1.136 tracks/csharp/generators/Exercises/PascalsTriangle.cs
trackler-2.2.1.135 tracks/csharp/generators/Exercises/PascalsTriangle.cs
trackler-2.2.1.134 tracks/csharp/generators/Exercises/PascalsTriangle.cs
trackler-2.2.1.133 tracks/csharp/generators/Exercises/PascalsTriangle.cs
trackler-2.2.1.132 tracks/csharp/generators/Exercises/PascalsTriangle.cs