Browse Source

test withdrawing a bit more

pull/130/head
jake 2 years ago
parent
commit
1028120048
  1. 22
      tests/test_bank.rs

22
tests/test_bank.rs

@ -2015,12 +2015,30 @@ async fn test_withdraw_meseta_from_shared_banks() {
unknown: 0,
})))).await.unwrap();
ship.handle(ClientId(1), RecvShipPacket::PlayerChat(PlayerChat::new(0, "\tE/bank".into()))).await.unwrap();
ship.handle(ClientId(1), RecvShipPacket::DirectMessage(DirectMessage::new(0, GameMessage::BankRequest(BankRequest {
client: 0,
target: 0,
unknown: 0,
})))).await.unwrap();
ship.handle(ClientId(1), RecvShipPacket::DirectMessage(DirectMessage::new(0, GameMessage::BankInteraction(BankInteraction {
client: 0,
target: 0,
item_id: 0xFFFFFFFF,
action: 1,
item_amount: 0,
meseta_amount: 5,
unknown: 0,
})))).await.unwrap();
let meseta = entity_gateway.get_character_meseta(&char1.id).await.unwrap();
let bank_meseta1 = entity_gateway.get_bank_meseta(&char1.id, &item::BankIdentifier::Character).await.unwrap();
let bank_meseta2 = entity_gateway.get_bank_meseta(&char1.id, &item::BankIdentifier::Shared(item::BankName("asdf".into()))).await.unwrap();
let bank_meseta3 = entity_gateway.get_bank_meseta(&char1.id, &item::BankIdentifier::Shared(item::BankName("qwer".into()))).await.unwrap();
assert_eq!(meseta.0, 23+55+32);
assert_eq!(bank_meseta1.0, 300-23);
assert_eq!(meseta.0, 23+55+32+5);
assert_eq!(bank_meseta1.0, 300-23-5);
assert_eq!(bank_meseta2.0, 300-55);
assert_eq!(bank_meseta3.0, 300-32);
}
Loading…
Cancel
Save