@@ -82,6 +82,90 @@ TEST_F(PendingAirdropIdUnitTests, FromProtobuf)
8282 EXPECT_FALSE (pendingAirdrop.mNft .has_value ());
8383}
8484
85+ // -----
86+ TEST_F (PendingAirdropIdUnitTests, FromProtobufNft)
87+ {
88+ // Given
89+ proto::PendingAirdropId proto;
90+ proto.mutable_sender_id ()->set_shardnum (1 );
91+ proto.mutable_sender_id ()->set_realmnum (2 );
92+ proto.mutable_sender_id ()->set_accountnum (3 );
93+
94+ proto.mutable_receiver_id ()->set_shardnum (4 );
95+ proto.mutable_receiver_id ()->set_realmnum (5 );
96+ proto.mutable_receiver_id ()->set_accountnum (6 );
97+
98+ proto.mutable_non_fungible_token ()->mutable_token_id ()->set_shardnum (7 );
99+ proto.mutable_non_fungible_token ()->mutable_token_id ()->set_realmnum (8 );
100+ proto.mutable_non_fungible_token ()->mutable_token_id ()->set_tokennum (9 );
101+ proto.mutable_non_fungible_token ()->set_serial_number (10 );
102+
103+ // When
104+ PendingAirdropId pendingAirdrop = PendingAirdropId::fromProtobuf (proto);
105+
106+ // Then
107+ EXPECT_EQ (pendingAirdrop.mSender , AccountId (1 , 2 , 3 ));
108+ EXPECT_EQ (pendingAirdrop.mReceiver , AccountId (4 , 5 , 6 ));
109+ EXPECT_FALSE (pendingAirdrop.mFt .has_value ());
110+ EXPECT_TRUE (pendingAirdrop.mNft .has_value ());
111+ EXPECT_EQ (pendingAirdrop.mNft .value (), NftId (TokenId (7 , 8 , 9 ), 10 ));
112+ }
113+
114+ // -----
115+ TEST_F (PendingAirdropIdUnitTests, OperatorEqualsFt)
116+ {
117+ // Given
118+ PendingAirdropId lhs (AccountId (1 , 2 , 3 ), AccountId (4 , 5 , 6 ), TokenId (7 , 8 , 9 ));
119+ PendingAirdropId rhs (AccountId (1 , 2 , 3 ), AccountId (4 , 5 , 6 ), TokenId (7 , 8 , 9 ));
120+
121+ // Then
122+ EXPECT_TRUE (lhs == rhs);
123+ }
124+
125+ // -----
126+ TEST_F (PendingAirdropIdUnitTests, OperatorEqualsNft)
127+ {
128+ // Given
129+ PendingAirdropId lhs (AccountId (1 , 2 , 3 ), AccountId (4 , 5 , 6 ), NftId (TokenId (7 , 8 , 9 ), 10 ));
130+ PendingAirdropId rhs (AccountId (1 , 2 , 3 ), AccountId (4 , 5 , 6 ), NftId (TokenId (7 , 8 , 9 ), 10 ));
131+
132+ // Then
133+ EXPECT_TRUE (lhs == rhs);
134+ }
135+
136+ // -----
137+ TEST_F (PendingAirdropIdUnitTests, OperatorNotEqualsDifferentSender)
138+ {
139+ // Given
140+ PendingAirdropId lhs (AccountId (1 , 2 , 3 ), AccountId (4 , 5 , 6 ), TokenId (7 , 8 , 9 ));
141+ PendingAirdropId rhs (AccountId (10 , 2 , 3 ), AccountId (4 , 5 , 6 ), TokenId (7 , 8 , 9 ));
142+
143+ // Then
144+ EXPECT_FALSE (lhs == rhs);
145+ }
146+
147+ // -----
148+ TEST_F (PendingAirdropIdUnitTests, OperatorNotEqualsDifferentReceiver)
149+ {
150+ // Given
151+ PendingAirdropId lhs (AccountId (1 , 2 , 3 ), AccountId (4 , 5 , 6 ), TokenId (7 , 8 , 9 ));
152+ PendingAirdropId rhs (AccountId (1 , 2 , 3 ), AccountId (4 , 5 , 10 ), TokenId (7 , 8 , 9 ));
153+
154+ // Then
155+ EXPECT_FALSE (lhs == rhs);
156+ }
157+
158+ // -----
159+ TEST_F (PendingAirdropIdUnitTests, OperatorNotEqualsDifferentToken)
160+ {
161+ // Given
162+ PendingAirdropId lhs (AccountId (1 , 2 , 3 ), AccountId (4 , 5 , 6 ), TokenId (7 , 8 , 9 ));
163+ PendingAirdropId rhs (AccountId (1 , 2 , 3 ), AccountId (4 , 5 , 6 ), TokenId (7 , 8 , 10 ));
164+
165+ // Then
166+ EXPECT_FALSE (lhs == rhs);
167+ }
168+
85169// -----
86170TEST_F (PendingAirdropIdUnitTests, ToProtobuf)
87171{
0 commit comments