当前位置: 首页>>代码示例>>Golang>>正文


Golang testutil.ExpectPassesRule函数代码示例

本文整理汇总了Golang中github.com/housinganywhere/graphql/testutil.ExpectPassesRule函数的典型用法代码示例。如果您正苦于以下问题:Golang ExpectPassesRule函数的具体用法?Golang ExpectPassesRule怎么用?Golang ExpectPassesRule使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ExpectPassesRule函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: TestValidate_FieldsOnCorrectType_AliasedInterfaceFieldSelection

func TestValidate_FieldsOnCorrectType_AliasedInterfaceFieldSelection(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.FieldsOnCorrectTypeRule, `
      fragment interfaceFieldSelection on Pet {
        otherName : name
      }
    `)
}
开发者ID:housinganywhere,项目名称:graphql,代码行数:7,代码来源:rules_fields_on_correct_type_test.go

示例2: TestValidate_KnownArgumentNames_DirectiveArgsAreKnown

func TestValidate_KnownArgumentNames_DirectiveArgsAreKnown(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.KnownArgumentNamesRule, `
      {
        dog @skip(if: true)
      }
    `)
}
开发者ID:housinganywhere,项目名称:graphql,代码行数:7,代码来源:rules_known_argument_names_test.go

示例3: TestValidate_AnonymousOperationMustBeAlone_OneAnonOperation

func TestValidate_AnonymousOperationMustBeAlone_OneAnonOperation(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.LoneAnonymousOperationRule, `
      {
        field
      }
    `)
}
开发者ID:housinganywhere,项目名称:graphql,代码行数:7,代码来源:rules_lone_anonymous_operation_rule_test.go

示例4: TestValidate_KnownArgumentNames_SingleArgIsKnown

func TestValidate_KnownArgumentNames_SingleArgIsKnown(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.KnownArgumentNamesRule, `
      fragment argOnRequiredArg on Dog {
        doesKnowCommand(dogCommand: SIT)
      }
    `)
}
开发者ID:housinganywhere,项目名称:graphql,代码行数:7,代码来源:rules_known_argument_names_test.go

示例5: TestValidate_KnownArgumentNames_MultipleArgsInReverseOrderAreKnown

func TestValidate_KnownArgumentNames_MultipleArgsInReverseOrderAreKnown(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.KnownArgumentNamesRule, `
      fragment multipleArgsReverseOrder on ComplicatedArgs {
        multipleReqs(req2: 2, req1: 1)
      }
    `)
}
开发者ID:housinganywhere,项目名称:graphql,代码行数:7,代码来源:rules_known_argument_names_test.go

示例6: TestValidate_UniqueArgumentNames_SameArgumentOnTwoDirectives

func TestValidate_UniqueArgumentNames_SameArgumentOnTwoDirectives(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.UniqueArgumentNamesRule, `
      {
        field @directive1(arg: "value") @directive2(arg: "value")
      }
    `)
}
开发者ID:housinganywhere,项目名称:graphql,代码行数:7,代码来源:rules_unique_argument_names_test.go

示例7: TestValidate_NoCircularFragmentSpreads_SpreadingTwiceIndirectlyIsNotCircular

func TestValidate_NoCircularFragmentSpreads_SpreadingTwiceIndirectlyIsNotCircular(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.NoFragmentCyclesRule, `
      fragment fragA on Dog { ...fragB, ...fragC }
      fragment fragB on Dog { ...fragC }
      fragment fragC on Dog { name }
    `)
}
开发者ID:housinganywhere,项目名称:graphql,代码行数:7,代码来源:rules_no_fragment_cycles_test.go

示例8: TestValidate_FragmentsOnCompositeTypes_InterfaceIsValidFragmentType

func TestValidate_FragmentsOnCompositeTypes_InterfaceIsValidFragmentType(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.FragmentsOnCompositeTypesRule, `
      fragment validFragment on Pet {
        name
      }
    `)
}
开发者ID:housinganywhere,项目名称:graphql,代码行数:7,代码来源:rules_fragments_on_composite_types_test.go

示例9: TestValidate_FragmentsOnCompositeTypes_UnionIsValidFragmentType

func TestValidate_FragmentsOnCompositeTypes_UnionIsValidFragmentType(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.FragmentsOnCompositeTypesRule, `
      fragment validFragment on CatOrDog {
        __typename
      }
    `)
}
开发者ID:housinganywhere,项目名称:graphql,代码行数:7,代码来源:rules_fragments_on_composite_types_test.go

示例10: TestValidate_UniqueFragmentNames_NoFragments

func TestValidate_UniqueFragmentNames_NoFragments(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.UniqueFragmentNamesRule, `
      {
        field
      }
    `)
}
开发者ID:housinganywhere,项目名称:graphql,代码行数:7,代码来源:rules_unique_fragment_names_test.go

示例11: TestValidate_FragmentsOnCompositeTypes_ObjectIsValidFragmentType

func TestValidate_FragmentsOnCompositeTypes_ObjectIsValidFragmentType(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.FragmentsOnCompositeTypesRule, `
      fragment validFragment on Dog {
        barks
      }
    `)
}
开发者ID:housinganywhere,项目名称:graphql,代码行数:7,代码来源:rules_fragments_on_composite_types_test.go

示例12: TestValidate_KnownFragmentNames_KnownFragmentNamesAreValid

func TestValidate_KnownFragmentNames_KnownFragmentNamesAreValid(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.KnownFragmentNamesRule, `
      {
        human(id: 4) {
          ...HumanFields1
          ... on Human {
            ...HumanFields2
          }
          ... {
            name
          }
        }
      }
      fragment HumanFields1 on Human {
        name
        ...HumanFields3
      }
      fragment HumanFields2 on Human {
        name
      }
      fragment HumanFields3 on Human {
        name
      }
    `)
}
开发者ID:housinganywhere,项目名称:graphql,代码行数:25,代码来源:rules_known_fragment_names_test.go

示例13: TestValidate_FieldsOnCorrectType_IgnoresFieldsOnUnknownType

func TestValidate_FieldsOnCorrectType_IgnoresFieldsOnUnknownType(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.FieldsOnCorrectTypeRule, `
      fragment unknownSelection on UnknownType {
        unknownField
      }
    `)
}
开发者ID:housinganywhere,项目名称:graphql,代码行数:7,代码来源:rules_fields_on_correct_type_test.go

示例14: TestValidate_FieldsOnCorrectType_LyingAliasSelection

func TestValidate_FieldsOnCorrectType_LyingAliasSelection(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.FieldsOnCorrectTypeRule, `
      fragment lyingAliasSelection on Dog {
        name : nickname
      }
    `)
}
开发者ID:housinganywhere,项目名称:graphql,代码行数:7,代码来源:rules_fields_on_correct_type_test.go

示例15: TestValidate_UniqueArgumentNames_NoArgumentsOnDirective

func TestValidate_UniqueArgumentNames_NoArgumentsOnDirective(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.UniqueArgumentNamesRule, `
      {
        field @directive
      }
    `)
}
开发者ID:housinganywhere,项目名称:graphql,代码行数:7,代码来源:rules_unique_argument_names_test.go


注:本文中的github.com/housinganywhere/graphql/testutil.ExpectPassesRule函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。