Exemplo n.º 1
0
        public void BeaconCanConstruct()
        {
            WebSocketC2 beacon = null;

            try
            {
                // Instantiate a configured beacon
                beacon = new WebSocketC2(_url);

                // Check that the channels were instaniated
                Assert.IsInstanceOfType(beacon.BeaconChannel, typeof(BeaconChannel));
                Assert.IsInstanceOfType(beacon.ServerChannel, typeof(WebSocketChannel));

                // Check that the property values are correct
                Assert.IsNotNull(beacon.UrlEndpoint);
                Assert.AreEqual(_url, beacon.UrlEndpoint);
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Failed: {ex.Message}");
                Assert.Fail();
            }
            finally
            {
                // Test specific clean up
                if (beacon != null && beacon.Started)
                {
                    beacon.Stop();
                }
            }
        }
Exemplo n.º 2
0
 public void Setup()
 {
     _beacon = new WebSocketC2();
 }