Sha256: 938cd9061470dbc791719eeefe99e74481559e8c554f4cc586706fd62ef29b03
Contents?: true
Size: 920 Bytes
Versions: 22
Compression:
Stored size: 920 Bytes
Contents
using System; using Generators.Output; using Humanizer; using Newtonsoft.Json.Linq; namespace Generators.Exercises { public class PerfectNumbers : Exercise { public PerfectNumbers() { foreach (var canonicalDataCase in CanonicalData.Cases) { canonicalDataCase.ExceptionThrown = canonicalDataCase.Expected is JObject ? typeof(ArgumentOutOfRangeException) : null; if (canonicalDataCase.Expected is string classificationType) canonicalDataCase.Expected = new UnescapedValue($"Classification.{classificationType.Transform(To.SentenceCase)}"); } } protected override TestClass CreateTestClass() { var testClass = base.CreateTestClass(); testClass.UsingNamespaces.Add(typeof(ArgumentOutOfRangeException).Namespace); return testClass; } } }
Version data entries
22 entries across 22 versions & 1 rubygems