forked from real-logic/simple-binary-encoding
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CSharp] Add meta attribute PRESENCE to generated codecs. Issue real-…
- Loading branch information
1 parent
963814f
commit 5c8c9cb
Showing
7 changed files
with
81 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
MSTEST='/c/Program Files (x86)/Microsoft Visual Studio 14.0/Common7/IDE/MSTest.exe' | ||
"$MSTEST" /testcontainer:sbe-tests/bin/Debug/Org.SbeTool.Sbe.UnitTests.dll | ||
"$MSTEST" /testcontainer:sbe-tests/bin/Debug/net45/Org.SbeTool.Sbe.UnitTests.dll | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright (C) 2017 MarketFactory, Inc | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
using System; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Org.SbeTool.Sbe.Dll; | ||
|
||
namespace Org.SbeTool.Sbe.Tests | ||
{ | ||
[TestClass] | ||
public unsafe class Issue483Tests | ||
{ | ||
private Issue483.Issue483 _issue483; | ||
|
||
[TestInitialize] | ||
public void SetUp() | ||
{ | ||
_issue483 = new Issue483.Issue483(); | ||
|
||
} | ||
|
||
[TestMethod] | ||
public void PresenceTest() | ||
{ | ||
// Check our attributes for their presence meta attribute | ||
Assert.AreEqual(Issue483.Issue483.UnsetMetaAttribute(Issue483.MetaAttribute.Presence), "required"); | ||
Assert.AreEqual(Issue483.Issue483.RequiredMetaAttribute(Issue483.MetaAttribute.Presence), "required"); | ||
Assert.AreEqual(Issue483.Issue483.ConstantMetaAttribute(Issue483.MetaAttribute.Presence), "constant"); | ||
Assert.AreEqual(Issue483.Issue483.OptionalMetaAttribute(Issue483.MetaAttribute.Presence), "optional"); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<sbe:messageSchema xmlns:sbe="http://fixprotocol.io/2016/sbe" | ||
package="issue483" | ||
id="483" | ||
version="0" | ||
semanticVersion="1.0" | ||
description="issue 483 test case" | ||
byteOrder="bigEndian"> | ||
<types> | ||
<composite name="messageHeader" description="Message identifiers and length of message root"> | ||
<type name="blockLength" primitiveType="uint16"/> | ||
<type name="templateId" primitiveType="uint16"/> | ||
<type name="schemaId" primitiveType="uint16"/> | ||
<type name="version" primitiveType="uint16"/> | ||
</composite> | ||
</types> | ||
<sbe:message name="issue483" id="1" description="issue 483 test"> | ||
<field name="unset" type="uint64" id="2"/> | ||
<field name="required" type="uint64" id="3" presence="required"/> | ||
<field name="constant" type="uint64" id="4" presence="constant"/> | ||
<field name="optional" type="uint64" id="5" presence="optional"/> | ||
</sbe:message> | ||
</sbe:messageSchema> |