public async Task TransactionReceiptFilter_ForContract_Filters_Out_Empty_Addresses() { var tx = new TransactionReceipt { ContractAddress = null }; var filter = TransactionReceiptFilter.ForContract(Address1); Assert.False(await filter.IsMatchAsync(tx)); }
public async Task TransactionReceiptFilter_ForContractOrEmpty_Does_Not_Matches_Different_Address() { var tx = new TransactionReceipt { ContractAddress = Address2 }; var filter = TransactionReceiptFilter.ForContractOrEmpty(Address1); Assert.False(await filter.IsMatchAsync(tx)); }
public async Task TransactionReceiptFilter_ForContractOrEmpty_Matches_Empty_Address() { var tx = new TransactionReceipt { ContractAddress = null }; var filter = TransactionReceiptFilter.ForContractOrEmpty(Address1); Assert.True(await filter.IsMatchAsync(tx)); }
public async Task TransactionReceiptFilter_ForContract_Matches() { var tx = new TransactionReceipt { ContractAddress = Address1 }; var filter = TransactionReceiptFilter.ForContract(Address1); Assert.True(await filter.IsMatchAsync(tx)); }
public async Task TransactionReceiptFilter_ForContractOrEmpty_Supports_Multiple_Addresses() { var tx1 = new TransactionReceipt { ContractAddress = Address1 }; var tx2 = new TransactionReceipt { ContractAddress = Address2 }; var tx3 = new TransactionReceipt { ContractAddress = UnknownAddress }; var tx4 = new TransactionReceipt { ContractAddress = null }; var filter = TransactionReceiptFilter.ForContractOrEmpty(new [] { Address1, Address2 }); Assert.True(await filter.IsMatchAsync(tx1)); Assert.True(await filter.IsMatchAsync(tx2)); Assert.False(await filter.IsMatchAsync(tx3)); Assert.True(await filter.IsMatchAsync(tx4)); }