public void SetToReturn_ExceptionTest() { PubkeyScript scr = new PubkeyScript(); byte[] nba = null; IScript nscr = null; Assert.Throws <ArgumentNullException>(() => scr.SetToReturn(nba)); Assert.Throws <ArgumentNullException>(() => scr.SetToReturn(nscr)); }
public void SetToReturn_FromBytesTest() { PubkeyScript scr = new PubkeyScript(); scr.SetToReturn(Helper.GetBytes(12)); byte[] expected = Helper.HexToBytes($"6a0c{Helper.GetBytesHex(12)}"); Assert.Equal(expected, scr.Data); }
public void SetToReturn_FromScriptTest() { PubkeyScript scr = new PubkeyScript(); var mock = new MockSerializableScript(new byte[] { 1, 2, 3 }, 255); scr.SetToReturn(mock); byte[] expected = Helper.HexToBytes("6a03010203"); Assert.Equal(expected, scr.Data); }