Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Breeze
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
Breeze
Commits
d89564d6
Commit
d89564d6
authored
May 22, 2017
by
Jeremy Bokobza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed tests and updated xunit nuget packages
parent
e752cba2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
9 deletions
+11
-9
Breeze.Api.Tests.csproj
Breeze/src/Breeze.Api.Tests/Breeze.Api.Tests.csproj
+2
-2
ControllersTests.cs
Breeze/src/Breeze.Api.Tests/ControllersTests.cs
+9
-7
No files found.
Breeze/src/Breeze.Api.Tests/Breeze.Api.Tests.csproj
View file @
d89564d6
...
@@ -17,9 +17,9 @@
...
@@ -17,9 +17,9 @@
<ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<PackageReference Include="NStratis" Version="3.0.2.23" />
<PackageReference Include="NStratis" Version="3.0.2.23" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0
-beta5-build1225
" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.3.0" />
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.2.0
-beta5-build3474
" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.0" />
<PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.0" />
<PackageReference Include="Moq" Version="4.7.10" />
<PackageReference Include="Moq" Version="4.7.10" />
</ItemGroup>
</ItemGroup>
...
...
Breeze/src/Breeze.Api.Tests/ControllersTests.cs
View file @
d89564d6
...
@@ -10,6 +10,8 @@ using Breeze.Wallet.Errors;
...
@@ -10,6 +10,8 @@ using Breeze.Wallet.Errors;
using
Breeze.Wallet.Helpers
;
using
Breeze.Wallet.Helpers
;
using
Breeze.Wallet.Models
;
using
Breeze.Wallet.Models
;
using
NBitcoin
;
using
NBitcoin
;
using
NBitcoin.Protocol
;
using
Stratis.Bitcoin.Configuration
;
using
Stratis.Bitcoin.Connection
;
using
Stratis.Bitcoin.Connection
;
namespace
Breeze.Api.Tests
namespace
Breeze.Api.Tests
...
@@ -22,8 +24,8 @@ namespace Breeze.Api.Tests
...
@@ -22,8 +24,8 @@ namespace Breeze.Api.Tests
Mnemonic
mnemonic
=
new
Mnemonic
(
Wordlist
.
English
,
WordCount
.
Twelve
);
Mnemonic
mnemonic
=
new
Mnemonic
(
Wordlist
.
English
,
WordCount
.
Twelve
);
var
mockWalletCreate
=
new
Mock
<
IWalletManager
>();
var
mockWalletCreate
=
new
Mock
<
IWalletManager
>();
mockWalletCreate
.
Setup
(
wallet
=>
wallet
.
CreateWallet
(
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>(),
null
)).
Returns
(
mnemonic
);
mockWalletCreate
.
Setup
(
wallet
=>
wallet
.
CreateWallet
(
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>(),
null
)).
Returns
(
mnemonic
);
var
controller
=
new
WalletController
(
mockWalletCreate
.
Object
,
new
Mock
<
ITracker
>().
Object
,
new
Mock
<
ConnectionManager
>().
Object
,
new
Mock
<
Network
>().
Object
,
new
Mock
<
ConcurrentChain
>().
Object
);
var
controller
=
new
WalletController
(
mockWalletCreate
.
Object
,
new
Mock
<
ITracker
>().
Object
,
It
.
IsAny
<
ConnectionManager
>(),
Network
.
Main
,
new
Mock
<
ConcurrentChain
>().
Object
);
// Act
// Act
var
result
=
controller
.
Create
(
new
WalletCreationRequest
var
result
=
controller
.
Create
(
new
WalletCreationRequest
...
@@ -51,9 +53,9 @@ namespace Breeze.Api.Tests
...
@@ -51,9 +53,9 @@ namespace Breeze.Api.Tests
};
};
var
mockWalletWrapper
=
new
Mock
<
IWalletManager
>();
var
mockWalletWrapper
=
new
Mock
<
IWalletManager
>();
mockWalletWrapper
.
Setup
(
w
=>
w
.
RecoverWallet
(
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>(),
null
,
It
.
IsAny
<
DateTime
>()
)).
Returns
(
wallet
);
mockWalletWrapper
.
Setup
(
w
=>
w
.
RecoverWallet
(
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>(),
It
.
IsAny
<
DateTime
>(),
null
)).
Returns
(
wallet
);
var
controller
=
new
WalletController
(
mockWalletWrapper
.
Object
,
new
Mock
<
ITracker
>().
Object
,
new
Mock
<
ConnectionManager
>().
Object
,
new
Mock
<
Network
>().
Object
,
new
Mock
<
ConcurrentChain
>().
Object
);
var
controller
=
new
WalletController
(
mockWalletWrapper
.
Object
,
new
Mock
<
ITracker
>().
Object
,
It
.
IsAny
<
ConnectionManager
>(),
Network
.
Main
,
new
Mock
<
ConcurrentChain
>().
Object
);
// Act
// Act
var
result
=
controller
.
Recover
(
new
WalletRecoveryRequest
var
result
=
controller
.
Recover
(
new
WalletRecoveryRequest
...
@@ -82,7 +84,7 @@ namespace Breeze.Api.Tests
...
@@ -82,7 +84,7 @@ namespace Breeze.Api.Tests
var
mockWalletWrapper
=
new
Mock
<
IWalletManager
>();
var
mockWalletWrapper
=
new
Mock
<
IWalletManager
>();
mockWalletWrapper
.
Setup
(
w
=>
w
.
LoadWallet
(
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>())).
Returns
(
wallet
);
mockWalletWrapper
.
Setup
(
w
=>
w
.
LoadWallet
(
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>())).
Returns
(
wallet
);
var
controller
=
new
WalletController
(
mockWalletWrapper
.
Object
,
new
Mock
<
ITracker
>().
Object
,
new
Mock
<
ConnectionManager
>().
Object
,
new
Mock
<
Network
>().
Object
,
new
Mock
<
ConcurrentChain
>().
Object
);
var
controller
=
new
WalletController
(
mockWalletWrapper
.
Object
,
new
Mock
<
ITracker
>().
Object
,
It
.
IsAny
<
ConnectionManager
>(),
Network
.
Main
,
new
Mock
<
ConcurrentChain
>().
Object
);
// Act
// Act
var
result
=
controller
.
Load
(
new
WalletLoadRequest
var
result
=
controller
.
Load
(
new
WalletLoadRequest
...
@@ -103,8 +105,8 @@ namespace Breeze.Api.Tests
...
@@ -103,8 +105,8 @@ namespace Breeze.Api.Tests
{
{
var
mockWalletWrapper
=
new
Mock
<
IWalletManager
>();
var
mockWalletWrapper
=
new
Mock
<
IWalletManager
>();
mockWalletWrapper
.
Setup
(
wallet
=>
wallet
.
LoadWallet
(
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>())).
Throws
<
FileNotFoundException
>();
mockWalletWrapper
.
Setup
(
wallet
=>
wallet
.
LoadWallet
(
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>(),
It
.
IsAny
<
string
>())).
Throws
<
FileNotFoundException
>();
var
controller
=
new
WalletController
(
mockWalletWrapper
.
Object
,
new
Mock
<
ITracker
>().
Object
,
new
Mock
<
ConnectionManager
>().
Object
,
new
Mock
<
Network
>().
Object
,
new
Mock
<
ConcurrentChain
>().
Object
);
var
controller
=
new
WalletController
(
mockWalletWrapper
.
Object
,
new
Mock
<
ITracker
>().
Object
,
It
.
IsAny
<
ConnectionManager
>(),
Network
.
Main
,
new
Mock
<
ConcurrentChain
>().
Object
);
// Act
// Act
var
result
=
controller
.
Load
(
new
WalletLoadRequest
var
result
=
controller
.
Load
(
new
WalletLoadRequest
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment