Skip to content

Commit

Permalink
Added Test to Royalty Fee Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Realkayzee committed Feb 4, 2024
1 parent f1f232b commit 361fa6e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
15 changes: 0 additions & 15 deletions flex_marketplace/tests/royalty_fee_managen_test.cairo

This file was deleted.

26 changes: 26 additions & 0 deletions flex_marketplace/tests/royalty_fee_manager_test.cairo
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");
}

0 comments on commit 361fa6e

Please sign in to comment.