示例#1
0
        public void ToStringItSelf()
        {
            var withdrawal           = new Withdrawal(new DateTime(2017, 2, 21), 100.00D, 150.00D);
            var stringRepresentation = withdrawal.ToString();

            Assert.That(stringRepresentation, Is.EqualTo("21/02/2017 | | 100.00 | 150.00"));
        }
示例#2
0
        public void test()
        {
            var pvtKey = "jqWoAa/jvXSc3QQVl0lI/s9MbeqkIBXOvVx08EKyfNk=";
            var pubKey = "6ZfNdq3EtXLJWX2kJAAgMoIgUUOZEKoJaOWl3e0muZM=";
            // var pvtKey = "KyfOaCCa7wBaMjMsw1JmTYeBObpYQYPBmj+dsuPf1sU=";
            // var pubKey = "BKOJ0U4+VgUTXkfEPjCst4+N+cgxVU6taNALpUnJnA/zbfAkcV7cd6INvBKWH3xT0wr0uHXfWYtKuUowwOG2DeI=";
            decimal quantity = 2;
            var     wd       = new Withdrawal();

            wd.SourceWallet = pubKey;
            wd.TargetWallet = "asdfasdf";
            wd.Asset        = "BTC";
            wd.Size         = quantity;
            wd.Signature    = CryptoHelper.Sign(wd.ToString(), pvtKey);

            wd.BuildHash();

            RestClient client  = new RestClient("http://localhost:5000/");
            var        request = new RestRequest("api/withdrawal", Method.POST);

            request.AddParameter("sourceWallet", pubKey);
            request.AddParameter("targetWallet", wd.TargetWallet);
            request.AddParameter("asset", wd.Asset);
            request.AddParameter("quantity", quantity);
            request.AddParameter("signature", wd.Signature);

            var response = client.Post(request);
        }
        public void CreateWithdrawalTransaction()
        {
            var transactionDate = new DateTime(2017, 2, 21);
            var clock           = new Mock <IClock>();

            clock.Setup(c => c.Today).Returns(transactionDate);
            var transactionFactory = new TransactionFactory(clock.Object);

            var expectedWithdrawal = new Withdrawal(transactionDate, 100.00D, 150.00);

            var withdrawal = transactionFactory.CreateWithdrawal(100.00D, 150.00D);

            Assert.AreEqual(expectedWithdrawal.ToString(), withdrawal.ToString());
        }