public void SaveLedgerAndRetreiveByIdTest_SavesAnObjectToDatabaseAndGetsThePrimaryKeyIdForDatabase_ChecksIfTheOutputIsAsExpected()
        {
            Ledger ledger = new Ledger("1234", DateTime.Now, LedgerType.Trade, new Currency("LTC", true), 1000.543m,
                                       0.005m, 23000, "trade123", "order123", null, null, new AccountId(1));

            _persistanceRepository.SaveOrUpdate(ledger);

            Ledger retrievedLedger = _ledgerRepository.GetLedgerByLedgerId("1234");

            Assert.IsNotNull(retrievedLedger);
            int id = retrievedLedger.Id;

            _persistanceRepository.SaveOrUpdate(retrievedLedger);

            retrievedLedger = _ledgerRepository.GetLedgerById(id);
            Assert.AreEqual(ledger.Currency.Name, retrievedLedger.Currency.Name);
            Assert.AreEqual(ledger.LedgerId, retrievedLedger.LedgerId);
            Assert.AreEqual(ledger.LedgerType, retrievedLedger.LedgerType);
            Assert.AreEqual(ledger.Amount, retrievedLedger.Amount);
            Assert.AreEqual(ledger.Fee, retrievedLedger.Fee);
            Assert.AreEqual(ledger.Balance, retrievedLedger.Balance);
            Assert.AreEqual(ledger.TradeId, retrievedLedger.TradeId);
            Assert.AreEqual(ledger.OrderId, retrievedLedger.OrderId);
            Assert.AreEqual(ledger.AccountId.Value, retrievedLedger.AccountId.Value);

            Assert.IsNull(retrievedLedger.WithdrawId);
            Assert.IsNull(retrievedLedger.DepositId);
        }
        /// <summary>
        /// Get the details for the given ledger ID
        /// </summary>
        /// <param name="ledgerId"></param>
        /// <returns></returns>
        public LedgerRepresentation GetLedgerDetails(string ledgerId)
        {
            Ledger ledger = _ledgerRepository.GetLedgerByLedgerId(ledgerId);

            return(new LedgerRepresentation(ledger.LedgerId, ledger.DateTime, ledger.LedgerType.ToString(), ledger.Currency.Name,
                                            ledger.Amount, ledger.AmountInUsd, ledger.Fee, ledger.Balance, ledger.TradeId, ledger.OrderId, ledger.WithdrawId,
                                            ledger.DepositId, ledger.AccountId.Value));
        }