Exemple #1
0
        public async void ShouldReturnOutput()
        {
            var senderAddress   = "0x12890d2cce102216644c59daE5baed380d84830c";
            var privateKey      = "0xb5b1870957d373ef0eeffecc6e4812c0fd08f554b37b233526acc331bf1544f7";
            var web3            = new Web3(new Account(privateKey));
            var contractReceipt = await web3.Eth.DeployContract.SendRequestAndWaitForReceiptAsync(TestOutputService.ABI,
                                                                                                  TestOutputService.BYTE_CODE, senderAddress, new HexBigInteger(900000));

            var service = new TestOutputService(web3, contractReceipt.ContractAddress);
            var message = await service.GetDataAsyncCall();

            Assert.Equal(1, (int)message.BirthTime);
            Assert.Equal(1, (int)message.CurrLocation);
            Assert.Equal(1, (int)message.StarterId);
            Assert.Equal(false, message.IsBusy);
            Assert.Equal("juan", message.UserName);
            Assert.Equal("0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae", message.Owner);
        }
Exemple #2
0
        public async void ShouldReturnFunctionOutputDTO()
        {
            var web3          = _ethereumClientIntegrationFixture.GetWeb3();
            var senderAddress = AccountFactory.Address;

            var contractReceipt = await web3.Eth.DeployContract.SendRequestAndWaitForReceiptAsync(TestOutputService.ABI,
                                                                                                  TestOutputService.BYTE_CODE, senderAddress, new HexBigInteger(900000));

            var service = new TestOutputService(web3, contractReceipt.ContractAddress);
            var message = await service.GetDataAsyncCall();

            Assert.Equal(1, (int)message.BirthTime);
            Assert.Equal(1, message.CurrLocation);
            Assert.Equal(1, message.StarterId);
            Assert.False(message.IsBusy);
            Assert.Equal("juan", message.UserName);
            Assert.Equal("0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae", message.Owner);
        }