コード例 #1
0
 public void TestInit()
 {
     if (SoundBoxServer.ActiveServer == null)
     {
         //Use UDP method first (faster)
         List <SoundBoxServer> servers = SoundBoxServer.FindServersUDP();
         if (servers.Count > 0)
         {
             servers[0].APICode         = "12345";
             servers[0].ApiCodeRequired = true;
             SoundBoxServer.SetActiveServer(servers[0]);
         }
         else
         {
             //Fall back on network scan if UDP failed
             servers = SoundBoxServer.FindAllServers();
             if (servers.Count > 0)
             {
                 servers[0].APICode = "12345";
                 SoundBoxServer.SetActiveServer(servers[0]);
             }
             else
             {
                 Assert.Fail("No servers found");
             }
         }
     }
 }
コード例 #2
0
        public void TestFindAllServers()
        {
            List <SoundBoxServer> servers = SoundBoxServer.FindAllServers();

            Assert.AreEqual(servers.Count, 1);
        }