當前位置: 首頁>>代碼示例>>Golang>>正文


Golang testutil.ExpectPassesRule函數代碼示例

本文整理匯總了Golang中github.com/graphql-go/graphql/testutil.ExpectPassesRule函數的典型用法代碼示例。如果您正苦於以下問題:Golang ExpectPassesRule函數的具體用法?Golang ExpectPassesRule怎麽用?Golang ExpectPassesRule使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了ExpectPassesRule函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: TestValidate_FieldsOnCorrectType_MetaFieldSelectionOnUnion

func TestValidate_FieldsOnCorrectType_MetaFieldSelectionOnUnion(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.FieldsOnCorrectTypeRule, `
      fragment directFieldSelectionOnUnion on CatOrDog {
        __typename
      }
    `)
}
開發者ID:cerisier,項目名稱:graphql,代碼行數:7,代碼來源:rules_fields_on_correct_type_test.go

示例2: TestValidate_UniqueArgumentNames_SameArgumentOnTwoDirectives

func TestValidate_UniqueArgumentNames_SameArgumentOnTwoDirectives(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.UniqueArgumentNamesRule, `
      {
        field @directive1(arg: "value") @directive2(arg: "value")
      }
    `)
}
開發者ID:yuanfeng0905,項目名稱:graphql,代碼行數:7,代碼來源:rules_unique_argument_names_test.go

示例3: TestValidate_AnonymousOperationMustBeAlone_NoOperations

func TestValidate_AnonymousOperationMustBeAlone_NoOperations(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.LoneAnonymousOperationRule, `
      fragment fragA on Type {
        field
      }
    `)
}
開發者ID:cerisier,項目名稱:graphql,代碼行數:7,代碼來源:rules_lone_anonymous_operation_rule_test.go

示例4: TestValidate_KnownArgumentNames_NoArgsOnOptionalArg

func TestValidate_KnownArgumentNames_NoArgsOnOptionalArg(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.KnownArgumentNamesRule, `
      fragment noArgOnOptionalArg on Dog {
        isHousetrained
      }
    `)
}
開發者ID:cerisier,項目名稱:graphql,代碼行數:7,代碼來源:rules_known_argument_names_test.go

示例5: TestValidate_UniqueArgumentNames_NoArgumentsOnDirective

func TestValidate_UniqueArgumentNames_NoArgumentsOnDirective(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.UniqueArgumentNamesRule, `
      {
        field @directive
      }
    `)
}
開發者ID:yuanfeng0905,項目名稱:graphql,代碼行數:7,代碼來源:rules_unique_argument_names_test.go

示例6: TestValidate_ProvidedNonNullArguments_DirectiveArguments_IgnoresUnknownDirectives

func TestValidate_ProvidedNonNullArguments_DirectiveArguments_IgnoresUnknownDirectives(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.ProvidedNonNullArgumentsRule, `
        {
          dog @unknown
        }
    `)
}
開發者ID:cerisier,項目名稱:graphql,代碼行數:7,代碼來源:rules_provided_non_null_arguments_test.go

示例7: TestValidate_KnownArgumentNames_IgnoresArgsOfUnknownFields

func TestValidate_KnownArgumentNames_IgnoresArgsOfUnknownFields(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.KnownArgumentNamesRule, `
      fragment argOnUnknownField on Dog {
        unknownField(unknownArg: SIT)
      }
    `)
}
開發者ID:cerisier,項目名稱:graphql,代碼行數:7,代碼來源:rules_known_argument_names_test.go

示例8: TestValidate_NoCircularFragmentSpreads_DoesNotFalsePositiveOnUnknownFragment

func TestValidate_NoCircularFragmentSpreads_DoesNotFalsePositiveOnUnknownFragment(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.NoFragmentCyclesRule, `
      fragment nameFragment on Pet {
        ...UnknownFragment
      }
    `)
}
開發者ID:trythings,項目名稱:trythings,代碼行數:7,代碼來源:rules_no_fragment_cycles_test.go

示例9: TestValidate_ScalarLeafs_ValidScalarSelection

func TestValidate_ScalarLeafs_ValidScalarSelection(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.ScalarLeafsRule, `
      fragment scalarSelection on Dog {
        barks
      }
    `)
}
開發者ID:cerisier,項目名稱:graphql,代碼行數:7,代碼來源:rules_scalar_leafs_test.go

示例10: TestValidate_VariableDefaultValuesOfCorrectType_VariablesWithNoDefaultValues

func TestValidate_VariableDefaultValuesOfCorrectType_VariablesWithNoDefaultValues(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.DefaultValuesOfCorrectTypeRule, `
      query NullableValues($a: Int, $b: String, $c: ComplexInput) {
        dog { name }
      }
    `)
}
開發者ID:cerisier,項目名稱:graphql,代碼行數:7,代碼來源:rules_default_values_of_correct_type_test.go

示例11: TestValidate_VariableDefaultValuesOfCorrectType_RequiredVariablesWithoutDefaultValues

func TestValidate_VariableDefaultValuesOfCorrectType_RequiredVariablesWithoutDefaultValues(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.DefaultValuesOfCorrectTypeRule, `
      query RequiredValues($a: Int!, $b: String!) {
        dog { name }
      }
    `)
}
開發者ID:cerisier,項目名稱:graphql,代碼行數:7,代碼來源:rules_default_values_of_correct_type_test.go

示例12: TestValidate_FieldsOnCorrectType_IgnoresFieldsOnUnknownType

func TestValidate_FieldsOnCorrectType_IgnoresFieldsOnUnknownType(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.FieldsOnCorrectTypeRule, `
      fragment unknownSelection on UnknownType {
        unknownField
      }
    `)
}
開發者ID:cerisier,項目名稱:graphql,代碼行數:7,代碼來源:rules_fields_on_correct_type_test.go

示例13: TestValidate_FieldsOnCorrectType_LyingAliasSelection

func TestValidate_FieldsOnCorrectType_LyingAliasSelection(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.FieldsOnCorrectTypeRule, `
      fragment lyingAliasSelection on Dog {
        name : nickname
      }
    `)
}
開發者ID:cerisier,項目名稱:graphql,代碼行數:7,代碼來源:rules_fields_on_correct_type_test.go

示例14: TestValidate_FieldsOnCorrectType_AliasedInterfaceFieldSelection

func TestValidate_FieldsOnCorrectType_AliasedInterfaceFieldSelection(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.FieldsOnCorrectTypeRule, `
      fragment interfaceFieldSelection on Pet {
        otherName : name
      }
    `)
}
開發者ID:cerisier,項目名稱:graphql,代碼行數:7,代碼來源:rules_fields_on_correct_type_test.go

示例15: TestValidate_FragmentsOnCompositeTypes_UnionIsValidFragmentType

func TestValidate_FragmentsOnCompositeTypes_UnionIsValidFragmentType(t *testing.T) {
	testutil.ExpectPassesRule(t, graphql.FragmentsOnCompositeTypesRule, `
      fragment validFragment on CatOrDog {
        __typename
      }
    `)
}
開發者ID:trythings,項目名稱:trythings,代碼行數:7,代碼來源:rules_fragments_on_composite_types_test.go


注:本文中的github.com/graphql-go/graphql/testutil.ExpectPassesRule函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。