예제 #1
0
    async Task DespositToken(System.Numerics.BigInteger amount)
    {
        var matic = Setting1.GetMatic();
        var from  = Setting1.FROM_ADDRESS;
        var token = Settings.ROPSTEN_TEST_TOKEN;
        await matic.ApproveERC20TokensForDeposit(from, token, amount);

        Debug.Log($"ApproveERC20TokensForDeposit finished");
        await matic.DepositERC20Tokens(from, from, token, amount);

        Debug.Log($"DepositERC20Tokens finished");
    }
 public void ReturnDevelopmentValue()
 {
     using (new DeploymentContextInjectionScope(targetEnvironment: TargetEnvironment.DEVELOPMENT))
     {
         DateSetting.Should().Be(new(2021, 3, 3));
         Setting1.Should().Be("one.1");
         Setting2.Should().Be(3);
         Setting3.Should().Be("three.1");
         Invoking(() => Setting4)
         .Should().Throw <NotSupportedException>()
         .WithMessage($"'{nameof(Setting4)}' does not provide a value for target environment '{TargetEnvironment.DEVELOPMENT}'.");
         Invoking(() => Setting5).Should().NotThrow().And.Subject().Should().Be(0);
         Setting6.Should().Be(1);
         Setting7.Should().Be(1);
     }
 }
 public void ReturnAcceptanceValue()
 {
     using (new DeploymentContextInjectionScope(targetEnvironment: TargetEnvironment.ACCEPTANCE))
     {
         DateSetting.Should().Be(DateTime.MinValue);
         Setting1.Should().Be("one.2");
         Setting2.Should().Be(1);
         Setting3.Should().Be("three.2");
         Invoking(() => Setting4).Should().NotThrow().And.Subject().Should().Be("four");
         Invoking(() => Setting5)
         .Should().Throw <NotSupportedException>()
         .WithMessage($"'{nameof(Setting5)}' does not provide a value for target environment '{TargetEnvironment.ACCEPTANCE}'.");
         Setting6.Should().Be(3);
         Setting7.Should().Be(4);
     }
 }
 public void ReturnBuildValue()
 {
     using (new DeploymentContextInjectionScope(targetEnvironment: TargetEnvironment.BUILD))
     {
         Invoking(() => DateSetting)
         .Should().Throw <NotSupportedException>()
         .WithMessage($"'{nameof(DateSetting)}' does not provide a value for target environment '{TargetEnvironment.BUILD}'.");
         Setting1.Should().Be("one.1");
         Setting2.Should().Be(2);
         Setting3.Should().Be("three.1");
         Invoking(() => Setting4)
         .Should().Throw <NotSupportedException>()
         .WithMessage($"'{nameof(Setting4)}' does not provide a value for target environment '{TargetEnvironment.BUILD}'.");
         Invoking(() => Setting5).Should().NotThrow().And.Subject().Should().Be(0);
         Setting6.Should().Be(2);
         Setting7.Should().Be(2);
     }
 }
예제 #5
0
    public static async Task <System.Numerics.BigInteger> BalanceOfERC20()
    {
        var matic = Setting1.GetMatic();

        return(await matic.BalanceOfERC20(Setting1.FROM_ADDRESS, Setting1.MATIC_TEST_TOKEN));
    }