-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1f232b
commit 361fa6e
Showing
2 changed files
with
26 additions
and
15 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use tests::utils::{setup, initialize_test, RECIPIENT}; | ||
use flex::marketplace::royalty_fee_manager::{ | ||
IRoyaltyFeeManagerDispatcher, IRoyaltyFeeManagerDispatcherTrait | ||
}; | ||
|
||
#[test] | ||
fn test_calculate_royalty_fee_and_get_recipient_success() { | ||
let dsp = setup(); | ||
let mocks = initialize_test(dsp); | ||
let (receiver, royaltyAmount) = dsp | ||
.fee_manager | ||
.calculate_royalty_fee_and_get_recipient(mocks.erc721, 1, 1000); | ||
assert!(receiver == RECIPIENT(), "Unexpected returned receiver"); | ||
assert!(royaltyAmount == 100, "Unexpected returned royalty amount"); | ||
} | ||
|
||
#[test] | ||
fn test_get_royalty_fee_registry() { | ||
let dsp = setup(); | ||
initialize_test(dsp); | ||
|
||
let registry = dsp.fee_registry.contract_address; | ||
let fee_registry = dsp.fee_manager.get_royalty_fee_registry(); | ||
|
||
assert!(registry == fee_registry.contract_address, "Unexpected returned Contract Address"); | ||
} |