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

            : GetTheoryAttributes(theory).ToArray();
예제 #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));
            }
        }