This repository has been archived by the owner on Apr 6, 2020. It is now read-only.
forked from neo-project/neo-gui-2.x
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed AssetState property from FirstClassAssetItem class (#104)
- Loading branch information
1 parent
4c0fb44
commit 64491a4
Showing
9 changed files
with
132 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
70 changes: 70 additions & 0 deletions
70
Neo.Gui.ViewModels.Tests/Builders/FirstClassAssetItemBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using Neo.Core; | ||
using Neo.Cryptography.ECC; | ||
|
||
using Neo.Gui.Base.Data; | ||
|
||
namespace Neo.Gui.ViewModels.Tests.Builders | ||
{ | ||
// TODO Add NEP5AssetItemBuilder class | ||
public class FirstClassAssetItemBuilder | ||
{ | ||
private string internalName = "Name"; | ||
private string internalValue = "Value"; | ||
private string internalIssuer = "Issuer"; | ||
private UInt256 internalAssetId = UInt256.Parse("0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF"); | ||
private ECPoint internalAssetOwner = new ECPoint(); | ||
private AssetType internalAssetType = AssetType.Token; | ||
|
||
public FirstClassAssetItemBuilder WithName(string name) | ||
{ | ||
this.internalName = name; | ||
return this; | ||
} | ||
|
||
public FirstClassAssetItemBuilder WithValue(string value) | ||
{ | ||
this.internalValue = value; | ||
return this; | ||
} | ||
|
||
public FirstClassAssetItemBuilder WithIssuer(string issuer) | ||
{ | ||
this.internalIssuer = issuer; | ||
return this; | ||
} | ||
|
||
public FirstClassAssetItemBuilder WithGoverningToken() | ||
{ | ||
this.internalAssetType = AssetType.GoverningToken; | ||
return this; | ||
} | ||
|
||
public FirstClassAssetItemBuilder WithUtilityToken() | ||
{ | ||
this.internalAssetType = AssetType.UtilityToken; | ||
return this; | ||
} | ||
|
||
public FirstClassAssetItemBuilder WithCustomToken() | ||
{ | ||
this.internalAssetOwner = new ECPoint(); | ||
return this; | ||
} | ||
|
||
public FirstClassAssetItemBuilder WithAssetId(UInt256 assetId) | ||
{ | ||
this.internalAssetId = assetId; | ||
return this; | ||
} | ||
|
||
public AssetItem Build() | ||
{ | ||
return new FirstClassAssetItem(this.internalAssetId, this.internalAssetOwner, this.internalAssetType) | ||
{ | ||
Name = this.internalName, | ||
Value = this.internalValue, | ||
Issuer = this.internalIssuer | ||
}; | ||
} | ||
} | ||
} |
Oops, something went wrong.