Browse Source

Improve tests

pull/3393/head
Thomas Kaul 1 year ago
parent
commit
b13995617c
  1. 45
      apps/api/src/app/portfolio/calculator/twr/portfolio-calculator-btcusd-buy-and-sell-partially.spec.ts

45
apps/api/src/app/portfolio/calculator/twr/portfolio-calculator-btcusd-buy-and-sell-partially.spec.ts

@ -140,19 +140,17 @@ describe('PortfolioCalculator', () => {
currentValueInBaseCurrency: new Big('13298.425356'), currentValueInBaseCurrency: new Big('13298.425356'),
errors: [], errors: [],
grossPerformance: new Big('27172.74').mul(0.97373), grossPerformance: new Big('27172.74').mul(0.97373),
// TODO grossPerformancePercentage: new Big('42.41983590271396606847'),
// grossPerformancePercentage: new Big('42.41978276196153750666'), grossPerformancePercentageWithCurrencyEffect: new Big(
// grossPerformancePercentageWithCurrencyEffect: new Big( '41.64017412624815595315'
// '41.6401219622042072686' ),
// ),
grossPerformanceWithCurrencyEffect: new Big('26516.208701400000064086'), grossPerformanceWithCurrencyEffect: new Big('26516.208701400000064086'),
hasErrors: false, hasErrors: false,
netPerformance: new Big('27172.74').mul(0.97373), netPerformance: new Big('27172.74').mul(0.97373),
// TODO netPerformancePercentage: new Big('42.41983590271396606847'),
// netPerformancePercentage: new Big('42.41978276196153750666'), netPerformancePercentageWithCurrencyEffect: new Big(
// netPerformancePercentageWithCurrencyEffect: new Big( '41.64017412624815595315'
// '41.6401219622042072686' ),
// ),
netPerformanceWithCurrencyEffect: new Big('26516.208701400000064086'), netPerformanceWithCurrencyEffect: new Big('26516.208701400000064086'),
positions: [ positions: [
{ {
@ -165,11 +163,10 @@ describe('PortfolioCalculator', () => {
feeInBaseCurrency: new Big('0'), feeInBaseCurrency: new Big('0'),
firstBuyDate: '2015-01-01', firstBuyDate: '2015-01-01',
grossPerformance: new Big('27172.74').mul(0.97373), grossPerformance: new Big('27172.74').mul(0.97373),
// TODO grossPerformancePercentage: new Big('42.41983590271396606847'),
// grossPerformancePercentage: new Big('42.41978276196153750666'), grossPerformancePercentageWithCurrencyEffect: new Big(
// grossPerformancePercentageWithCurrencyEffect: new Big( '41.64017412624815595315'
// '41.6401219622042072686' ),
// ),
grossPerformanceWithCurrencyEffect: new Big( grossPerformanceWithCurrencyEffect: new Big(
'26516.208701400000064086' '26516.208701400000064086'
), ),
@ -178,22 +175,20 @@ describe('PortfolioCalculator', () => {
marketPrice: 13657.2, marketPrice: 13657.2,
marketPriceInBaseCurrency: 13298.425356, marketPriceInBaseCurrency: 13298.425356,
netPerformance: new Big('27172.74').mul(0.97373), netPerformance: new Big('27172.74').mul(0.97373),
// TODO netPerformancePercentage: new Big('42.41983590271396606847'),
// netPerformancePercentage: new Big('42.41978276196153750666'), netPerformancePercentageWithCurrencyEffect: new Big(
// netPerformancePercentageWithCurrencyEffect: new Big( '41.64017412624815595315'
// '41.6401219622042072686' ),
// ),
netPerformanceWithCurrencyEffect: new Big( netPerformanceWithCurrencyEffect: new Big(
'26516.208701400000064086' '26516.208701400000064086'
), ),
quantity: new Big('1'), quantity: new Big('1'),
symbol: 'BTCUSD', symbol: 'BTCUSD',
tags: [], tags: [],
// TODO timeWeightedInvestment: new Big('623.73914366102470303356'),
// timeWeightedInvestment: new Big('640.56763686131386861314'), timeWeightedInvestmentWithCurrencyEffect: new Big(
// timeWeightedInvestmentWithCurrencyEffect: new Big( '636.79389574611155572775'
// '636.79469348020066587024' ),
// ),
transactionCount: 2, transactionCount: 2,
valueInBaseCurrency: new Big('13298.425356') valueInBaseCurrency: new Big('13298.425356')
} }

Loading…
Cancel
Save