From 48641f98300217751f4a782f10bb88c375b2dfb3 Mon Sep 17 00:00:00 2001 From: Vitor Nazario Coelho Date: Tue, 27 Aug 2024 23:57:37 -0300 Subject: [PATCH] TestWallet is mocked --- tests/Neo.Plugins.DBFTPlugin.Tests/UT_ConsensusService.cs | 5 +++++ tests/Neo.UnitTests/TestWalletAccount.cs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/Neo.Plugins.DBFTPlugin.Tests/UT_ConsensusService.cs b/tests/Neo.Plugins.DBFTPlugin.Tests/UT_ConsensusService.cs index 05040f7e96..7cc171229c 100644 --- a/tests/Neo.Plugins.DBFTPlugin.Tests/UT_ConsensusService.cs +++ b/tests/Neo.Plugins.DBFTPlugin.Tests/UT_ConsensusService.cs @@ -24,6 +24,8 @@ using System.Net; using System.Numerics; using System.Text; +using Neo.Plugins.DBFTPlugin.Consensus; +using Neo.UnitTests; namespace Neo.Plugins.DBFTPlugin.Tests { @@ -75,6 +77,9 @@ public void ConsensusService_SingleNodeActors_OnStart_PrepReq_PrepResponses_Comm var mockNeoSystem = new Mock(); var mockWallet = new Mock(); + mockWallet.Setup(p => p.GetAccount(It.IsAny())).Returns(p => new TestWalletAccount(p)); + Console.WriteLine($"\n(UT-Consensus) Wallet is: {mockWallet.Object.GetAccount(UInt160.Zero).GetKey().PublicKey}"); + var mockContext = new Mock(mockNeoSystem.Object, mockWallet.Object, ProtocolSettings.Default); } } diff --git a/tests/Neo.UnitTests/TestWalletAccount.cs b/tests/Neo.UnitTests/TestWalletAccount.cs index 08686cf70b..fb0ee80d1e 100644 --- a/tests/Neo.UnitTests/TestWalletAccount.cs +++ b/tests/Neo.UnitTests/TestWalletAccount.cs @@ -16,7 +16,7 @@ namespace Neo.UnitTests { - class TestWalletAccount : WalletAccount + public class TestWalletAccount : WalletAccount { private static readonly KeyPair key;