File tree Expand file tree Collapse file tree
SteamQueryNet/SteamQueryNet.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212using System . Linq ;
1313using System . Net ;
1414using System . Net . Sockets ;
15-
15+ using System . Threading . Tasks ;
1616using Xunit ;
1717
1818namespace SteamQueryNet . Tests
@@ -113,6 +113,28 @@ public void GetPlayers_ShouldPopulateCorrectPlayers()
113113 }
114114 }
115115
116+ /*
117+ * We keep this test here to be able to have us a notifier when the Rules API becomes available.
118+ * So, this is more like an integration test than an unit test.
119+ * If this test starts to fail, we'll know that the Rules API started to respond.
120+ */
121+ [ Fact ]
122+ public void GetRules_ShouldThrowTimeoutException ( )
123+ {
124+ // Surf Heaven rulez.
125+ const string trustedServer = "steam://connect/54.37.111.217:27015" ;
126+
127+ using ( var sq = new ServerQuery ( ) )
128+ {
129+ sq . Connect ( trustedServer ) ;
130+
131+ // Make sure that the server is still alive.
132+ Assert . True ( sq . IsConnected ) ;
133+ bool responded = Task . WaitAll ( new Task [ ] { sq . GetRulesAsync ( ) } , 2000 ) ;
134+ Assert . True ( ! responded ) ;
135+ }
136+ }
137+
116138 private void SetupRequestCompare ( IEnumerable < byte [ ] > requestPackets , Mock < IUdpClient > udpClientMock )
117139 {
118140 udpClientMock
You can’t perform that action at this time.
0 commit comments