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
e524ccbe
Commit
e524ccbe
authored
May 22, 2017
by
Jeremy Bokobza
Committed by
GitHub
May 22, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74 from bokobza/pre-alpha-dev-release
Fixed tests and updated xunit nuget packages
parents
2cf7a185
d89564d6
Show 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 @
e524ccbe
...
...
@@ -17,9 +17,9 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
<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="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="Moq" Version="4.7.10" />
</ItemGroup>
...
...
Breeze/src/Breeze.Api.Tests/ControllersTests.cs
View file @
e524ccbe
...
...
@@ -10,6 +10,8 @@ using Breeze.Wallet.Errors;
using
Breeze.Wallet.Helpers
;
using
Breeze.Wallet.Models
;
using
NBitcoin
;
using
NBitcoin.Protocol
;
using
Stratis.Bitcoin.Configuration
;
using
Stratis.Bitcoin.Connection
;
namespace
Breeze.Api.Tests
...
...
@@ -23,7 +25,7 @@ namespace Breeze.Api.Tests
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
);
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
var
result
=
controller
.
Create
(
new
WalletCreationRequest
...
...
@@ -51,9 +53,9 @@ namespace Breeze.Api.Tests
};
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
var
result
=
controller
.
Recover
(
new
WalletRecoveryRequest
...
...
@@ -82,7 +84,7 @@ namespace Breeze.Api.Tests
var
mockWalletWrapper
=
new
Mock
<
IWalletManager
>();
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
var
result
=
controller
.
Load
(
new
WalletLoadRequest
...
...
@@ -104,7 +106,7 @@ namespace Breeze.Api.Tests
var
mockWalletWrapper
=
new
Mock
<
IWalletManager
>();
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
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