File tree 1 file changed +30
-0
lines changed
test/std/functions/protected/protection 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity ^ 0.8.24 ;
3
+
4
+ import {Test} from "forge-std/Test.sol " ;
5
+
6
+ import {Initialization} from "mc-std/functions/protected/protection/Initialization.sol " ;
7
+ import {Storage} from "mc-std/storage/Storage.sol " ;
8
+
9
+ contract InitializationTest is Test {
10
+
11
+ function test_ShouldNotBeCompleted_Success () public {
12
+ Initialization.shouldNotBeCompleted ();
13
+ }
14
+
15
+ function test_ShouldNotBeCompleted_RevertIf_VersionIsNotZero () public {
16
+ Storage.Initialization ().initialized = 1 ;
17
+
18
+ vm.expectRevert (Initialization.InvalidInitialization.selector );
19
+ Initialization.shouldNotBeCompleted ();
20
+ }
21
+
22
+ function test_WillBeCompleted_Success () public {
23
+ vm.expectEmit (address (this ));
24
+ emit Initialization.Initialized (1 );
25
+ Initialization.willBeCompleted ();
26
+
27
+ assertEq (Storage.Initialization ().initialized, 1 );
28
+ }
29
+
30
+ }
You can’t perform that action at this time.
0 commit comments