Advertisement
apalchikovskiy

Untitled

Jan 16th, 2020
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. package com.emfxe.test
  2.  
  3. import com.emfxe.model.position.OpenPosition
  4. import org.junit.Test
  5. import org.junit.Assert
  6. import java.math.BigDecimal
  7.  
  8.  
  9. class OpenPositionTest {
  10.  
  11. val firstOpenPosition = OpenPosition(100000482,153.toBigDecimal(),1, 20181,1.2566.toBigDecimal(), BigDecimal.ZERO,BigDecimal.ZERO,"15-02-2019", 1, BigDecimal.ONE, 23,"name", 123.toBigDecimal(), "USD", "USD", 1.23.toBigDecimal(), 1, 52.toBigDecimal(), 10000.toBigDecimal(),5)
  12. val secondOpenPosition = OpenPosition(100000482,153.toBigDecimal(),1, 2018,1.2566.toBigDecimal(), BigDecimal.ZERO,BigDecimal.ZERO,"15-02-2019", 1, BigDecimal.ONE, 23,"name", 123.toBigDecimal(), "USD", "USD", 1.23.toBigDecimal(), 1, 52.toBigDecimal(), 10000.toBigDecimal(),5)
  13.  
  14. //check formattedNav
  15. @Test
  16. fun checkIsSameForEqualsPositions(){
  17.  
  18. val openPositionEqualsFirstOpenPosition = OpenPosition(100000482,153.toBigDecimal(),1, 20181,1.2566.toBigDecimal(), BigDecimal.ZERO,BigDecimal.ZERO,"15-02-2019", 1, BigDecimal.ONE, 23,"name", 123.toBigDecimal(), "USD", "USD", 1.23.toBigDecimal(), 1, 52.toBigDecimal(), 10000.toBigDecimal(),5)
  19. Assert.assertTrue(this.firstOpenPosition.isSame(openPositionEqualsFirstOpenPosition))
  20. }
  21. @Test
  22. fun checkIsSameForNotEqualsPositions(){
  23.  
  24. val same = this.firstOpenPosition.isSame(this.secondOpenPosition)
  25. Assert.assertFalse(same)
  26. }
  27.  
  28. //check getCurrentValue
  29. @Test
  30. fun checkGetCurrentValue(){
  31.  
  32. val currentValue : String = firstOpenPosition.getCurrentValue(152.toBigDecimal())
  33.  
  34.  
  35. }
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement