garritfra
6 years ago
1 changed files with 18 additions and 0 deletions
@ -0,0 +1,18 @@
|
||||
package core |
||||
|
||||
import ( |
||||
"testing" |
||||
) |
||||
|
||||
func TestBlock_AddTransaction(t *testing.T) { |
||||
block := Block{} |
||||
transaction := Transaction{Sender: "foo", Receiver: "bar", Message: "Test", Amount: 100} |
||||
block.AddTransaction(transaction) |
||||
|
||||
want := transaction |
||||
got := block.Data[0] |
||||
|
||||
if want != got { |
||||
t.Errorf("Want: %v, but got %v", want, got) |
||||
} |
||||
} |
Loading…
Reference in new issue