Beispiel #1
0
        private static Attribute[] GetAttributes(XUnitTheory theory)
        => theory == null
            ? new Attribute[]
        {
            XUnitAttributes.Fact()
        }

            : GetTheoryAttributes(theory).ToArray();
Beispiel #2
0
        private static IEnumerable <Attribute> GetTheoryAttributes(XUnitTheory theory)
        {
            yield return(XUnitAttributes.Theory());

            var memberData = theory.MemberDataNameOfLiteral;

            if (!string.IsNullOrWhiteSpace(memberData))
            {
                yield return(XUnitAttributes.MemberData(memberData));

                yield break;
            }

            foreach (var literal in theory.InlineDataLiterals)
            {
                yield return(XUnitAttributes.InlineData(literal));
            }
        }