Sha256: 58239a06e83e305e20a1e54cedce8a05d2063cea7fb0d8aad3bdfd9e2508c862
Contents?: true
Size: 880 Bytes
Versions: 22
Compression:
Stored size: 880 Bytes
Contents
using System.Collections; using System.Collections.Generic; using System.Linq; namespace Generators.Output { public class EqualityTestMethodGenerator : TestMethodGenerator { protected override IEnumerable<string> Body { get { if (ExpectedIsEmptyEnumerable) return Variables.Append($"Assert.Empty({TestedValue});"); return Variables.Append($"Assert.Equal({ExpectedParameter}, {TestedValue});"); } } protected override bool UseVariableForExpected => base.UseVariableForExpected && !ExpectedIsEmptyEnumerable; private bool ExpectedIsEmptyEnumerable => !(CanonicalDataCase.Expected is string) && CanonicalDataCase.Expected is IEnumerable enumerable && enumerable.GetEnumerator().MoveNext() == false; } }
Version data entries
22 entries across 22 versions & 1 rubygems