Пример #1
0
        private IEnumerable <TestCaseData> Test_GetReferencedRelationshipTypes_Source()
        {
            // Using a Func<StructuredQuery> rather than a straight StructuredQuery to
            // avoid issues with NUnit and using a CallContext in a TestCaseSource method.

            yield return(new TestCaseData((Func <StructuredQuery>)(() => TestQueries.Entities()), new string[0]));

            yield return(new TestCaseData((Func <StructuredQuery>)(() => TestQueries.AccessRulesWithNamedPermission("read")), new[] { "core:permissionAccess" }));

            // Get multiple relationships form the root entity, including an enum
            yield return(new TestCaseData((Func <StructuredQuery>)(() => TestQueries.ActiveUsersInRole("administrators")), new[] { "core:userHasRole", "core:accountStatus" }));

            // Test nested related resource nodes and reverse relationships
            yield return(new TestCaseData((Func <StructuredQuery>)(() => TestQueries.TypesSecuredBySubjects("administrators")), new[] { "core:allowAccess", "core:controlAccess" }));
        }
Пример #2
0
        private IEnumerable <TestCaseData> Test_GetFieldTypesReferencedByCondition_Source()
        {
            // Using a Func<StructuredQuery> rather than a straight StructuredQuery to
            // avoid issues with NUnit and using a CallContext in a TestCaseSource method.

            yield return(new TestCaseData((Func <StructuredQuery>)(() => TestQueries.Entities()), new string[0]));

            yield return(new TestCaseData((Func <StructuredQuery>)(() => TestQueries.EntitiesWithNameA()), new[] { "core:name" }));

            yield return(new TestCaseData((Func <StructuredQuery>)(() => TestQueries.EntitiesWithDescription()), new[] { "core:description" }));

            yield return(new TestCaseData((Func <StructuredQuery>)(() => TestQueries.EntitiesWithNameDescription("a", "a")), new[] { "core:name", "core:description" }));

            yield return(new TestCaseData((Func <StructuredQuery>)(() => TestQueries.EntitiesWithNameAndDescriptionInResults("a")), new[] { "core:name" }));

            yield return(new TestCaseData((Func <StructuredQuery>)(() => TestQueries.AccessRulesWithNamedPermission("read")), new[] { "core:name", "core:accessRuleEnabled" }));

            yield return(new TestCaseData((Func <StructuredQuery>)(() => TestQueries.ActiveUsersInRole("administrators")), new[] { "core:name", "core:alias" }));
        }