Skip to content

Commit

Permalink
♻️ Renamed tests & create test modules
Browse files Browse the repository at this point in the history
  • Loading branch information
MattPoblete committed Dec 2, 2024
1 parent 437d309 commit e464a39
Show file tree
Hide file tree
Showing 42 changed files with 3,499 additions and 66 deletions.
4 changes: 1 addition & 3 deletions apps/contracts/factory/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,4 @@ impl<'a> DeFindexFactoryTest<'a> {
}
}

mod admin;
mod initialize;
mod create_defindex;
mod factory;
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use alloc::vec;
use crate::test::DeFindexFactoryTest;

#[test]
fn test_set_new_admin_by_admin() {
fn set_new_admin_by_admin() {

let test = DeFindexFactoryTest::setup();

Expand Down Expand Up @@ -46,7 +46,7 @@ fn test_set_new_admin_by_admin() {

#[test]
#[should_panic(expected = "HostError: Error(Auth, InvalidAction)")] // Unauthorized
fn test_set_new_admin_by_unauthorized() {
fn set_new_admin_by_unauthorized() {
let test = DeFindexFactoryTest::setup();

test.factory_contract.initialize(&test.admin, &test.defindex_receiver, &100u32, &test.defindex_wasm_hash);
Expand All @@ -69,7 +69,7 @@ fn test_set_new_admin_by_unauthorized() {
}

#[test]
fn test_set_defindex_receiver_by_admin() {
fn set_defindex_receiver_by_admin() {
let test = DeFindexFactoryTest::setup();

test.factory_contract.initialize(&test.admin, &test.defindex_receiver, &100u32, &test.defindex_wasm_hash);
Expand Down Expand Up @@ -109,7 +109,7 @@ fn test_set_defindex_receiver_by_admin() {

#[test]
#[should_panic(expected = "HostError: Error(Auth, InvalidAction)")] // Unauthorized
fn test_set_fee_receiver_by_unauthorized() {
fn set_fee_receiver_by_unauthorized() {
let test = DeFindexFactoryTest::setup();

test.factory_contract.initialize(&test.admin, &test.defindex_receiver, &100u32, &test.defindex_wasm_hash);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use soroban_sdk::{vec, BytesN, String, Vec};
use crate::test::{create_asset_params, DeFindexFactoryTest};

#[test]
fn test_create_defindex_success() {
fn create_success() {
let test = DeFindexFactoryTest::setup();

test.factory_contract.initialize(&test.admin, &test.defindex_receiver, &100u32, &test.defindex_wasm_hash);
Expand All @@ -28,7 +28,7 @@ fn test_create_defindex_success() {
}

#[test]
fn test_create_defindex_deposit_success() {
fn create_and_deposit_success() {
let test = DeFindexFactoryTest::setup();
test.env.mock_all_auths();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::error::FactoryError;
use crate::test::{create_asset_params, DeFindexFactoryTest};

#[test]
fn test_initialize_and_get_storage() {
fn initialize_and_get_storage() {
let test = DeFindexFactoryTest::setup();

test.factory_contract.initialize(&test.admin, &test.defindex_receiver, &100u32, &test.defindex_wasm_hash);
Expand All @@ -17,7 +17,7 @@ fn test_initialize_and_get_storage() {
}

#[test]
fn test_get_storage_not_yet_initialized() {
fn get_storage_not_yet_initialized() {
let test = DeFindexFactoryTest::setup();
let factory_admin = test.factory_contract.try_admin();
let factory_defindex_receiver = test.factory_contract.try_defindex_receiver();
Expand All @@ -27,7 +27,7 @@ fn test_get_storage_not_yet_initialized() {
}

#[test]
fn test_initialize_twice() {
fn initialize_twice() {
let test = DeFindexFactoryTest::setup();

test.factory_contract.initialize(&test.admin, &test.defindex_receiver, &100u32, &test.defindex_wasm_hash);
Expand All @@ -40,7 +40,7 @@ fn test_initialize_twice() {
}

#[test]
fn test_create_defindex_not_yet_initialized() {
fn create_defindex_not_yet_initialized() {
let test = DeFindexFactoryTest::setup();

let asset_params = create_asset_params(&test);
Expand Down
3 changes: 3 additions & 0 deletions apps/contracts/factory/src/test/factory/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mod admin;
mod create_defindex;
mod initialize;
4 changes: 2 additions & 2 deletions apps/contracts/integration-test/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ impl<'a> IntegrationTest<'a> {
}

#[cfg(test)]
mod test_vault_one_hodl_strategy;
mod test_vault_one_fixed_strategy;
mod vault_one_hodl_strategy;
mod vault_one_fixed_strategy;

This file was deleted.

Loading

0 comments on commit e464a39

Please sign in to comment.