Sha256: 0a61ad63910565fb3c2305fb735ac4b7ac20acfd38d437a93a702da82821c6fe
Contents?: true
Size: 1.09 KB
Versions: 78
Compression:
Stored size: 1.09 KB
Contents
using System; using Generators.Helpers; namespace Generators.Methods { public class BooleanTestMethodGenerator : TestMethodGenerator { protected override string Body { get { switch (TestMethodData.Options.TestedMethodType) { case TestedMethodType.Static: return $"{Assertion}({TestedClassName}.{TestedMethod}({Input}));"; case TestedMethodType.Instance: return $"var sut = new {TestedClassName}();\n {Assertion}(sut.{TestedMethod}({Input}));"; case TestedMethodType.Extension: return $"{Assertion}({Input}.{TestedMethod}());"; default: throw new ArgumentOutOfRangeException(); } } } private string Assertion => $"Assert.{Convert.ToBoolean(TestMethodData.CanonicalDataCase.Expected)}"; protected override string TestedMethod => base.TestedMethod.EnsureStartsWith("Is"); } }
Version data entries
78 entries across 78 versions & 1 rubygems