Browse Source

fix asserts in bank tests

pull/44/head
andy 4 years ago
committed by jake
parent
commit
32326a91f8
  1. 32
      tests/test_bank.rs

32
tests/test_bank.rs

@ -293,8 +293,8 @@ async fn test_deposit_individual_item() {
unknown: 0,
})))).await.unwrap().collect::<Vec<_>>();
assert!(packets.len() == 1);
assert!(matches!(&packets[0], (ClientId(2), SendShipPacket::Message(Message {msg: GameMessage::PlayerNoLongerHasItem(player_no_longer_has_item)}))
assert!(packets.len() == 2);
assert!(matches!(&packets[1], (ClientId(2), SendShipPacket::Message(Message {msg: GameMessage::PlayerNoLongerHasItem(player_no_longer_has_item)}))
if player_no_longer_has_item.item_id == 0x10001
&& player_no_longer_has_item.amount == 0
));
@ -356,8 +356,8 @@ async fn test_deposit_stacked_item() {
unknown: 0,
})))).await.unwrap().collect::<Vec<_>>();
assert!(packets.len() == 1);
assert!(matches!(&packets[0], (ClientId(2), SendShipPacket::Message(Message {msg: GameMessage::PlayerNoLongerHasItem(player_no_longer_has_item)}))
assert!(packets.len() == 2);
assert!(matches!(&packets[1], (ClientId(2), SendShipPacket::Message(Message {msg: GameMessage::PlayerNoLongerHasItem(player_no_longer_has_item)}))
if player_no_longer_has_item.item_id == 0x10000
&& player_no_longer_has_item.amount == 3
));
@ -420,8 +420,8 @@ async fn test_deposit_partial_stacked_item() {
unknown: 0,
})))).await.unwrap().collect::<Vec<_>>();
assert!(packets.len() == 1);
assert!(matches!(&packets[0], (ClientId(2), SendShipPacket::Message(Message {msg: GameMessage::PlayerNoLongerHasItem(player_no_longer_has_item)}))
assert!(packets.len() == 2);
assert!(matches!(&packets[1], (ClientId(2), SendShipPacket::Message(Message {msg: GameMessage::PlayerNoLongerHasItem(player_no_longer_has_item)}))
if player_no_longer_has_item.item_id == 0x10000
&& player_no_longer_has_item.amount == 2
));
@ -508,8 +508,8 @@ async fn test_deposit_stacked_item_with_stack_already_in_bank() {
unknown: 0,
})))).await.unwrap().collect::<Vec<_>>();
assert!(packets.len() == 1);
assert!(matches!(&packets[0], (ClientId(2), SendShipPacket::Message(Message {msg: GameMessage::PlayerNoLongerHasItem(player_no_longer_has_item)}))
assert!(packets.len() == 2);
assert!(matches!(&packets[1], (ClientId(2), SendShipPacket::Message(Message {msg: GameMessage::PlayerNoLongerHasItem(player_no_longer_has_item)}))
if player_no_longer_has_item.item_id == 0x10000
&& player_no_longer_has_item.amount == 2
));
@ -1024,8 +1024,8 @@ async fn test_withdraw_individual_item() {
unknown: 0,
})))).await.unwrap().collect::<Vec<_>>();
assert!(packets.len() == 1);
assert!(matches!(&packets[0], (ClientId(2), SendShipPacket::Message(Message {msg: GameMessage::CreateItem(create_item)}))
assert!(packets.len() == 2);
assert!(matches!(&packets[1], (ClientId(2), SendShipPacket::Message(Message {msg: GameMessage::CreateItem(create_item)}))
if create_item.item_id == 0x20000
));
@ -1088,8 +1088,8 @@ async fn test_withdraw_stacked_item() {
unknown: 0,
})))).await.unwrap().collect::<Vec<_>>();
assert!(packets.len() == 1);
assert!(matches!(&packets[0], (ClientId(2), SendShipPacket::Message(Message {msg: GameMessage::CreateItem(create_item)}))
assert!(packets.len() == 2);
assert!(matches!(&packets[1], (ClientId(2), SendShipPacket::Message(Message {msg: GameMessage::CreateItem(create_item)}))
if create_item.item_id == 0x10002
));
@ -1151,8 +1151,8 @@ async fn test_withdraw_partial_stacked_item() {
unknown: 0,
})))).await.unwrap().collect::<Vec<_>>();
assert!(packets.len() == 1);
assert!(matches!(&packets[0], (ClientId(2), SendShipPacket::Message(Message {msg: GameMessage::CreateItem(create_item)}))
assert!(packets.len() == 2);
assert!(matches!(&packets[1], (ClientId(2), SendShipPacket::Message(Message {msg: GameMessage::CreateItem(create_item)}))
if create_item.item_id == 0x10002
));
@ -1236,8 +1236,8 @@ async fn test_withdraw_stacked_item_with_stack_already_in_inventory() {
unknown: 0,
})))).await.unwrap().collect::<Vec<_>>();
assert!(packets.len() == 1);
assert!(matches!(&packets[0], (ClientId(2), SendShipPacket::Message(Message {msg: GameMessage::CreateItem(create_item)}))
assert!(packets.len() == 2);
assert!(matches!(&packets[1], (ClientId(2), SendShipPacket::Message(Message {msg: GameMessage::CreateItem(create_item)}))
if create_item.item_id == 0x10000
));

Loading…
Cancel
Save