@@ -26,6 +26,7 @@ public void ConstructorSetsInitialHandlers()
2626 Assert . NotNull ( steamClient . GetHandler < SteamMatchmaking > ( ) ) ;
2727 Assert . NotNull ( steamClient . GetHandler < SteamNetworking > ( ) ) ;
2828 Assert . NotNull ( steamClient . GetHandler < SteamContent > ( ) ) ;
29+ Assert . NotNull ( steamClient . GetHandler < SteamAuthTicket > ( ) ) ;
2930 }
3031
3132 [ Fact ]
@@ -62,6 +63,43 @@ public void RemoveHandlerRemovesHandlerByInstance()
6263 Assert . Null ( steamClient . GetHandler < TestMsgHandler > ( ) ) ;
6364 }
6465
66+ [ Fact ]
67+ public void AddHandlerThrowsOnDuplicateHandler ( )
68+ {
69+ var steamClient = new SteamClient ( ) ;
70+ steamClient . AddHandler ( new TestMsgHandler ( ) ) ;
71+
72+ Assert . Throws < InvalidOperationException > ( ( ) => steamClient . AddHandler ( new TestMsgHandler ( ) ) ) ;
73+ }
74+
75+ [ Fact ]
76+ public void RemoveHandlerByTypeDoesNothingWhenNotRegistered ( )
77+ {
78+ var steamClient = new SteamClient ( ) ;
79+ Assert . Null ( steamClient . GetHandler < TestMsgHandler > ( ) ) ;
80+
81+ steamClient . RemoveHandler ( typeof ( TestMsgHandler ) ) ;
82+ Assert . Null ( steamClient . GetHandler < TestMsgHandler > ( ) ) ;
83+ }
84+
85+ [ Fact ]
86+ public void GetRequiredHandlerReturnsHandler ( )
87+ {
88+ var steamClient = new SteamClient ( ) ;
89+ var handler = steamClient . GetRequiredHandler < SteamUser > ( ) ;
90+
91+ Assert . NotNull ( handler ) ;
92+ Assert . IsType < SteamUser > ( handler ) ;
93+ }
94+
95+ [ Fact ]
96+ public void GetRequiredHandlerThrowsWhenNotRegistered ( )
97+ {
98+ var steamClient = new SteamClient ( ) ;
99+
100+ Assert . Throws < InvalidOperationException > ( ( ) => steamClient . GetRequiredHandler < TestMsgHandler > ( ) ) ;
101+ }
102+
65103 [ Fact ]
66104 public void GetNextJobIDIsThreadsafe ( )
67105 {
0 commit comments