-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EdmLib Vocabulary Annotation Default Values #2173
Conversation
src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsVocabularyAnnotation.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OData.Edm/Csdl/Serialization/EdmModelCsdlSchemaXmlWriter.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OData.Edm/Csdl/Serialization/EdmModelCsdlSerializationVisitor.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OData.Edm/Vocabularies/Annotations/EdmVocabularyAnnotation.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OData.Edm/Vocabularies/Annotations/EdmVocabularyAnnotation.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OData.Edm/Vocabularies/Annotations/EdmVocabularyAnnotation.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OData.Edm/Vocabularies/Annotations/IEdmVocabularyAnnotation.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OData.Edm/Vocabularies/Annotations/IEdmVocabularyAnnotationWithDefault.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OData.Edm/Vocabularies/Annotations/EdmVocabularyAnnotation.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OData.Edm/Vocabularies/Annotations/EdmVocabularyAnnotation.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OData.Edm/Vocabularies/Annotations/EdmVocabularyAnnotation.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OData.Edm/Csdl/Serialization/EdmModelCsdlSchemaXmlWriter.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OData.Edm/Csdl/Serialization/EdmModelCsdlSchemaXmlWriter.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OData.Edm/Vocabularies/Annotations/EdmVocabularyAnnotation.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OData.Edm/Vocabularies/Annotations/EdmVocabularyAnnotation.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OData.Edm/Vocabularies/Annotations/EdmTermExtensions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsVocabularyAnnotation.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsVocabularyAnnotation.cs
Outdated
Show resolved
Hide resolved
Assert.Equal("{\"state\":[\"wa\",\"ca\"]}", resultsArray[1]); | ||
Assert.Equal("\"test\"", resultsArray[2]); | ||
|
||
// TODO: add additional cases - empty array, empty string, null, whitespace, special chars, etc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should add test case to test the mail methods in this class.
For example:
BuildDefaultEdmExpression
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I finished testing the first constructor in the class.
TODO: Test BuildEdmExpression(CsdlSemanticsVocabularyAnnotation annotation)
src/Microsoft.OData.Edm/Vocabularies/Annotations/EdmVocabularyAnnotation.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.OData.Edm/Csdl/Semantics/CsdlSemanticsVocabularyAnnotation.cs
Outdated
Show resolved
Hide resolved
{ | ||
private readonly IEdmVocabularyAnnotatable target; | ||
private readonly IEdmTerm term; | ||
private readonly string qualifier; | ||
private readonly IEdmExpression value; | ||
private readonly bool usesDefault; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private readonly bool usesDefault;
I don't think we need a field here since it is readonly
and UsesDefault
only has a getter #Resolved
"</edmx:DataServices>" + | ||
"</edmx:Edmx>"; | ||
// Parse into CSDL | ||
var model = CsdlReader.Parse(XElement.Parse(csdl).CreateReader()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var model = CsdlReader.Parse(XElement.Parse(csdl).CreateReader());
CreateReader
returns an object that implements IDisposable
. It should be wrapped in a using
block #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other tests also have this issue
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) In reply to: 948997785 In reply to: 948997785 |
src/Microsoft.OData.Edm/Csdl/Serialization/EdmModelCsdlSchemaXmlWriter.cs
Show resolved
Hide resolved
src/Microsoft.OData.Edm/Vocabularies/Annotations/EdmVocabularyAnnotation.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged at 0fc80da |
Description
This pull request adds support for using default values in vocabulary annotations in EdmLib.
Checklist
Additional work necessary
BuildEdmExpression(CsdlSemanticsVocabularyAnnotation annotation)