-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ShawnYun
authored
Aug 26, 2020
1 parent
6dabc1f
commit 792e1d3
Showing
3 changed files
with
41 additions
and
2 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
19 changes: 19 additions & 0 deletions
19
tests/Neo.Compiler.MSIL.UnitTests/TestClasses/Contract_StaticByteArray.cs
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,19 @@ | ||
using System; | ||
using System.ComponentModel; | ||
using System.Numerics; | ||
|
||
namespace Neo.Compiler.MSIL.TestClasses | ||
{ | ||
class Contract_StaticByteArray : SmartContract.Framework.SmartContract | ||
{ | ||
[DisplayName("TestEvent")] | ||
public static event Action<byte[]> OnEvent; | ||
|
||
static byte[] NeoToken = new byte[] { 0x89, 0x77, 0x20, 0xd8, 0xcd, 0x76, 0xf4, 0xf0, 0x0a, 0xbf, 0xa3, 0x7c, 0x0e, 0xdd, 0x88, 0x9c, 0x20, 0x8f, 0xde, 0x9b }; | ||
|
||
public static byte[] TestStaticByteArray() | ||
{ | ||
return NeoToken; | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
tests/Neo.Compiler.MSIL.UnitTests/UnitTest_StaticByteArray.cs
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,19 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Neo.Compiler.MSIL.UnitTests.Utils; | ||
|
||
namespace Neo.Compiler.MSIL.UnitTests | ||
{ | ||
[TestClass] | ||
public class UnitTest_StaticByteArray | ||
{ | ||
[TestMethod] | ||
public void TestStaticByteArray() | ||
{ | ||
var testengine = new TestEngine(); | ||
testengine.AddEntryScript("./TestClasses/Contract_StaticByteArray.cs"); | ||
var result = testengine.ExecuteTestCaseStandard("testStaticByteArray").Pop(); | ||
var wantResult = new byte[] { 0x89, 0x77, 0x20, 0xd8, 0xcd, 0x76, 0xf4, 0xf0, 0x0a, 0xbf, 0xa3, 0x7c, 0x0e, 0xdd, 0x88, 0x9c, 0x20, 0x8f, 0xde, 0x9b }; | ||
Assert.AreEqual(wantResult, result); | ||
} | ||
} | ||
} |