public void GetTotalAmount() { Account acc = Init.CreateAccountCurrency1(); FXMarket fxMkt = Init.CreateFXMarket(); AssetMarket aMkt = Init.CreateAssetMarket(); acc.ModifyTotalCcy(fxMkt, aMkt, Init.Ccy2()); double tot = acc.GetTotalAmount(Init.Ccy1(), fxMkt); Assert.IsTrue(tot == acc.Amount); }
public void ModifyCcy_CcyTest() { Account acc = Init.CreateAccountCurrency1(); double amount = acc.Amount; FXMarket fxMkt = Init.CreateFXMarket(); AssetMarket aMkt = Init.CreateAssetMarket(); acc.ModifyCcy(fxMkt, aMkt, "NOT USED", Init.Ccy2(), false); //last input not used for Accounts Assert.IsTrue( acc.Ccy.Ccy == Init.Ccy2() && acc.Amount == amount && acc.ConvertedAmount == amount * fxMkt.GetQuote(new CurrencyPair(Init.Ccy2(), Init.Ccy1())) ); }
public void ModifyTotalCcy_AssetTest() { Account acc = Init.CreateAccountAsset1(); FXMarket fxMkt = Init.CreateFXMarket(); AssetMarket aMkt = Init.CreateAssetMarket(fxMkt); acc.ModifyTotalCcy(fxMkt, aMkt, fxMkt.CcyRef); Assert.IsTrue( acc.TotalCcy == fxMkt.CcyRef && acc.TotalAmount == acc.Amount * aMkt.GetQuote(new AssetCcyPair(Init.Asset1(), Init.Ccy2())) ); }