2019-11-08 23:38:06 +00:00
|
|
|
|
using System;
|
|
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
|
using Storj;
|
|
|
|
|
|
|
|
|
|
namespace StorjTests
|
|
|
|
|
{
|
|
|
|
|
[TestClass]
|
|
|
|
|
public class ValidateWalletTests
|
|
|
|
|
{
|
|
|
|
|
[TestMethod]
|
|
|
|
|
[ExpectedExceptionWithMessage(typeof(ArgumentException), "The payout address cannot be empty.")]
|
|
|
|
|
public void NullWallet()
|
|
|
|
|
{
|
2019-11-14 12:02:03 +00:00
|
|
|
|
new CustomActionRunner().ValidateWallet(null);
|
2019-11-08 23:38:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
[ExpectedExceptionWithMessage(typeof(ArgumentException), "The payout address cannot be empty.")]
|
|
|
|
|
public void EmptyWallet()
|
|
|
|
|
{
|
2019-11-14 12:02:03 +00:00
|
|
|
|
new CustomActionRunner().ValidateWallet("");
|
2019-11-08 23:38:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
[ExpectedExceptionWithMessage(typeof(ArgumentException), "The payout address must start with a '0x' prefix.")]
|
|
|
|
|
public void PrefixMissing()
|
|
|
|
|
{
|
2019-11-14 12:02:03 +00:00
|
|
|
|
new CustomActionRunner().ValidateWallet("e857955cfCd98bAe1073d4e314c3F9526799357A");
|
2019-11-08 23:38:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
[ExpectedExceptionWithMessage(typeof(ArgumentException), "The payout address must have 40 characters after the '0x' prefix.")]
|
|
|
|
|
public void TooShortWallet()
|
|
|
|
|
{
|
2019-11-14 12:02:03 +00:00
|
|
|
|
new CustomActionRunner().ValidateWallet("0xe857955cfCd98bAe1073d4e314c3F9526799357");
|
2019-11-08 23:38:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
[ExpectedExceptionWithMessage(typeof(ArgumentException), "The payout address must have 40 characters after the '0x' prefix.")]
|
|
|
|
|
public void TooLongWallet()
|
|
|
|
|
{
|
2019-11-14 12:02:03 +00:00
|
|
|
|
new CustomActionRunner().ValidateWallet("0xe857955cfCd98bAe1073d4e314c3F9526799357A0");
|
2019-11-08 23:38:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[TestMethod]
|
|
|
|
|
public void ValidWallet()
|
|
|
|
|
{
|
2019-11-14 12:02:03 +00:00
|
|
|
|
new CustomActionRunner().ValidateWallet("0xe857955cfCd98bAe1073d4e314c3F9526799357A");
|
2019-11-08 23:38:06 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|