1+ using Mocha ;
2+ using Mocha . Common ;
3+
4+ namespace Mocha . Tests ;
5+
6+ [ TestClass ]
7+ public class EntityTickTests
8+ {
9+ [ TestMethod ]
10+ public void TestEntityImplementsTickInterface ( )
11+ {
12+ // Create a test actor instance
13+ var actor = new TestActor ( ) ;
14+
15+ // Verify it implements IActor correctly
16+ Assert . IsInstanceOfType ( actor , typeof ( IActor ) ) ;
17+
18+ // Verify it has both Update and FrameUpdate methods
19+ var updateMethod = actor . GetType ( ) . GetMethod ( "Update" ) ;
20+ var frameUpdateMethod = actor . GetType ( ) . GetMethod ( "FrameUpdate" ) ;
21+
22+ Assert . IsNotNull ( updateMethod ) ;
23+ Assert . IsNotNull ( frameUpdateMethod ) ;
24+ }
25+
26+ [ TestMethod ]
27+ public void TestIActorInterfaceHasBothMethods ( )
28+ {
29+ // Verify IActor interface has both required methods
30+ var iactorType = typeof ( IActor ) ;
31+ var updateMethod = iactorType . GetMethod ( "Update" ) ;
32+ var frameUpdateMethod = iactorType . GetMethod ( "FrameUpdate" ) ;
33+
34+ Assert . IsNotNull ( updateMethod , "IActor interface should have Update method" ) ;
35+ Assert . IsNotNull ( frameUpdateMethod , "IActor interface should have FrameUpdate method" ) ;
36+ }
37+ }
38+
39+ // Test actor for validating interface compliance
40+ public class TestActor : Actor
41+ {
42+ public bool UpdateCalled { get ; private set ; } = false ;
43+ public bool FrameUpdateCalled { get ; private set ; } = false ;
44+
45+ public override void Update ( )
46+ {
47+ UpdateCalled = true ;
48+ base . Update ( ) ;
49+ }
50+
51+ public override void FrameUpdate ( )
52+ {
53+ FrameUpdateCalled = true ;
54+ base . FrameUpdate ( ) ;
55+ }
56+ }
0 commit comments