def setUp(self): # Fixture setup state = AccountState(AccountId.from_string("BITMEX-1513111-SIMULATED"), BTC, Money(10., BTC), Money(0., BTC), Money(0., BTC), uuid4(), UNIX_EPOCH) self.account = Account(state)
def setUp(self): # Fixture Setup self.clock = TestClock() uuid_factor = TestUUIDFactory() logger = TestLogger(self.clock) self.order_factory = OrderFactory( strategy_id=StrategyId("S", "001"), id_tag_trader=IdTag("001"), id_tag_strategy=IdTag("001"), clock=TestClock(), ) state = AccountState( AccountId.from_string("BITMEX-1513111-SIMULATED"), BTC, Money(10., BTC), Money(0., BTC), Money(0., BTC), uuid4(), UNIX_EPOCH ) self.account = Account(state) self.portfolio = Portfolio(self.clock, uuid_factor, logger) self.portfolio.register_account(self.account)
def test_account_identifier(self): # Arrange # Act account_id1 = AccountId('FXCM', "02851908", AccountType.DEMO) account_id2 = AccountId('FXCM', "09999999", AccountType.DEMO) # Assert self.assertEqual(account_id1, account_id1) self.assertNotEqual(account_id1, account_id2) self.assertEqual("FXCM-02851908-DEMO", account_id1.value) self.assertEqual(Issuer("FXCM"), account_id1.issuer) self.assertEqual(account_id1, AccountId.from_string("FXCM-02851908-DEMO"))