Skip to content

Commit

Permalink
Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
rosona committed Dec 28, 2018
1 parent fa4b4af commit c9ce9f9
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 29 deletions.
2 changes: 1 addition & 1 deletion AElf.CLI2/aelf-sdk
1 change: 1 addition & 0 deletions AElf.Contracts.Token/TokenContract.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Linq;
using AElf.Kernel;
using AElf.Sdk.CSharp;
using AElf.Sdk.CSharp.Types;
Expand Down
16 changes: 8 additions & 8 deletions AElf.Management.Tests/ChainServiceTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using AElf.Management.Models;
using AElf.Management.Services;
using Xunit;
Expand All @@ -11,27 +11,27 @@ public class ChainServiceTest

[Fact(Skip = "require aws account")]
//[Fact]
public void DeployTestChain()
public async Task DeployTestChainTest()
{
var arg = new DeployArg();
arg.AccountPassword = "123";
arg.DBArg = new DeployDBArg();
arg.LighthouseArg=new DeployLighthouseArg();
arg.LighthouseArg = new DeployLighthouseArg();
arg.LighthouseArg.IsCluster = false;
arg.WorkArg = new DeployWorkArg();
arg.LauncherArg=new DeployLauncherArg();
arg.LauncherArg = new DeployLauncherArg();
arg.LauncherArg.IsConsensusInfoGenerator = true;

var service = new ChainService();
service.DeployMainChain(arg);
await service.DeployMainChain(arg);
}

[Fact(Skip = "require aws account")]
//[Fact]
public void RemoveTestChain()
public async Task RemoveTestChainTest()
{
var service = new ChainService();
service.RemoveMainChain(chainId);
await service.RemoveMainChain(chainId);
}
}
}
27 changes: 11 additions & 16 deletions AElf.Management.Tests/SideChainServiceTests.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices.ComTypes;
using AElf.Common.Application;
using AElf.Cryptography;
using System.Threading.Tasks;
using AElf.Management.Models;
using AElf.Management.Services;
using Xunit;
Expand All @@ -11,35 +7,34 @@ namespace AElf.Management.Tests
{
public class SideChainServiceTests
{
private string _chainId = "kPBx";//Guid.NewGuid().ToString("N");
private string _chainId = "kPBx"; //Guid.NewGuid().ToString("N");

[Fact(Skip = "require aws account")]
//[Fact]
public void DeployTest()
public async Task DeployTest()
{
var password = "123";

var arg = new DeployArg();
arg.MainChainId = _chainId;
arg.AccountPassword = password;
arg.DBArg = new DeployDBArg();
arg.LighthouseArg=new DeployLighthouseArg();
arg.LighthouseArg = new DeployLighthouseArg();
arg.LighthouseArg.IsCluster = false;
arg.WorkArg = new DeployWorkArg();
arg.LauncherArg=new DeployLauncherArg();
arg.LauncherArg = new DeployLauncherArg();
arg.LauncherArg.IsConsensusInfoGenerator = true;

var service = new SideChainService();
service.Deploy(arg);
await service.Deploy(arg);
}

[Fact(Skip = "require aws account")]
//[Fact]
public void RemoveTest()
public async Task RemoveTest()
{
var service = new SideChainService();

service.Remove(_chainId);
await service.Remove(_chainId);
}
}
}
8 changes: 4 additions & 4 deletions AElf.Management.Tests/WorkerServiceTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using AElf.Management.Services;
using System.Threading.Tasks;
using AElf.Management.Services;
using Xunit;

namespace AElf.Management.Tests
Expand All @@ -7,11 +8,10 @@ public class WorkerServiceTest
{
[Fact(Skip = "require aws account")]
//[Fact]
public void TestModifyWorkerCount()
public async Task ModifyWorkerCountTest()
{
var service = new WorkerService();

service.ModifyWorkerCount("default", 2);
await service.ModifyWorkerCount("default", 2);
}
}
}

0 comments on commit c9ce9f9

Please sign in to comment.