Пример #1
0
        public void TransferBet_ByPropertyName()
        {
            Bet bet = new Bet()
            {
                Id = 1, Stake = 344.4, CreateDate = new DateTime(2018, 12, 1), Status = "Running"
            };

            BetDto betDto = Mapper.TransferBet(bet);

            Assert.AreEqual("Running", betDto.Status);
        }
Пример #2
0
        public void TransferBet_Interface()
        {
            Bet bet = new Bet()
            {
                Id = 1, Stake = 344.4, CreateDate = new DateTime(2018, 12, 1)
            };

            BetDto betDto = Mapper.TransferBet <Bet, BetDto>(bet, new LuluMapper());

            Assert.AreEqual(1, betDto.BetId);
            Assert.AreEqual("2018-12-01", betDto.Date);
            Assert.AreEqual(344, betDto.Amount);
        }
Пример #3
0
        public void TransferBet()
        {
            Bet bet = new Bet()
            {
                Id = 1, Stake = 344.4, CreateDate = new DateTime(2018, 12, 1)
            };

            BetDto betDto = Mapper.TransferBet <Bet, BetDto>(bet, b => new BetDto()
            {
                BetId  = b.Id,
                Date   = b.CreateDate.ToString("yyyy-MM-dd"),
                Amount = (int)b.Stake
            });

            Assert.AreEqual(1, betDto.BetId);
            Assert.AreEqual("2018-12-01", betDto.Date);
            Assert.AreEqual(344, betDto.Amount);
        }