Open mabdi opened 4 years ago
And:
testMergedFields
| request form mergedFields |
request := ZnRequest post: 'http://host.com/foo?x=1&y=2&x=3'.
form := ZnApplicationFormUrlEncodedEntity new.
form
at: #z put: '100';
at: #z add: '200';
at: #y put: '0'.
request entity: form.
mergedFields := request mergedFields.
self assert: mergedFields keys sorted equals: #(x y z).
self assert: (mergedFields at: #x) sorted equals: #('1' '3').
self assert: (mergedFields at: #y) sorted equals: #('0' '2').
self assert: (mergedFields at: #z) sorted equals: #('100' '200')
I get:
request := ZnRequest post: 'http:/D/host.com/foo?x=1&y=2&x=3'.
form := ZnApplicationFormUrlEncodedEntity new.
form := form
at: #z put: '100';
at: #z add: '200';
at: #y put: '0'.
testFailValidateInterfaceTypeExtension
| valid |
schema := self parseSchema: '
schema {
query: Query
}
type GQLFilm implements RelevantData {
name: String
}
interface RelevantData{
name : String
}
extend interface OtherInterface{
id: String
}'.
self should: [ schema validate ] raise: GQLValidationException.
schema := self parseSchema: '
schema {
query: Query
}
type GQLFilm implements RelevantData {
name: String
}
interface RelevantData{
name : String
}
extend interface RelevantData{
name: String
id: String
}'.
self should: [ schema validate ] raise: GQLValidationException.
schema := self parseSchema: '
schema {
query: GQLTestFilm
}
interface NamedEntity{
name: String
}
extend interface NamedEntity{
id: String
}
type GQLTestFilm implements NamedEntity{
name: String
}'.
self should: [ schema validate ] raise: GQLValidationException.
schema := self parseSchema: '
schema {
query: GQLTestFilm
}
interface NamedEntity{
name: String
}
extend interface NamedEntity{
id: String
}
type GQLTestFilm{
filmName: String
}
extend type GQLTestFilm implements NamedEntity{
id: String
}'.
valid := schema validate.
self should: [ schema validate ] raise: GQLValidationException.
I get:
testFailValidateInterfaceTypeExtension_amp
"I test correctness of:
- `^ query` in method: `GQLSSchemaNode >> #query` when {#query->nil}
"
<madeBySmallAmp>
| valid |
schema := self
parseSchema:
'
schema {
query: Query
}
type GQLFilm implements RelevantData {
name: String
}
interface RelevantData{
name : String
}
extend interface OtherInterface{
id: String
}';
assert: schema query isNil;
parseSchema:
'
schema {
query: Query
}
type GQLFilm implements RelevantData {
name: String
}
interface RelevantData{
name : String
}
extend interface RelevantData{
name: String
id: String
}';
parseSchema:
'
schema {
query: GQLTestFilm
}
interface NamedEntity{
name: String
}
extend interface NamedEntity{
id: String
}
type GQLTestFilm implements NamedEntity{
name: String
}'.
valid := (self
parseSchema:
'
schema {
query: GQLTestFilm
}
interface NamedEntity{
name: String
}
extend interface NamedEntity{
id: String
}
type GQLTestFilm{
filmName: String
}
extend type GQLTestFilm implements NamedEntity{
id: String
}') validate
(Line with assert) It should first set schema
then assert the value. Using cascade in this example is not correct.
This method from zinc project:
is converted to it:
Line 5 of Which does not look correct. Why the dictionary variable is set to the result of
Dictionary>>#at:add:
?