示例#1
0
        public void ConstructorNotMatchingCurrencies()
        {
            var pair    = TradingPairTests.GetTradingPair("BNB", "ETH", 2);
            var balance = new Balance(new Currency("EOS"), 0, 0);

            Assert.Throws <ArgumentException>(() => new TradeProposal(pair, balance));
        }
示例#2
0
        public void ConstructorHappyFlow()
        {
            var pair     = TradingPairTests.GetTradingPair("BNB", "ETH", 20);
            var proposal = new TradeProposal(pair, new Balance(new Currency("BNB"), 1, 0.00000001M));

            Assert.Equal(1, proposal.From.Free);
            Assert.Equal(0.00000001M, proposal.From.Locked);
        }
示例#3
0
        public void ConstructorPerformsRounding()
        {
            var pair     = TradingPairTests.GetTradingPair("BNB", "ETH", 2);
            var balance  = new Balance(new Currency("BNB"), 42.1234569M, 0.000000000099M);
            var proposal = new TradeProposal(pair, balance);

            Assert.Equal(42.12M, proposal.From.Free);
            Assert.Equal(0, proposal.From.Locked);
        }