Пример #1
0
 public AgentTestBase()
 {
     _connector = new AgentConnector()
     {
         Host = _host
     };
 }
Пример #2
0
        public async Task Authentication_ConnectConcurrently2ConnectorsToTestMasterShouldSucceed()
        {
            //Arrange
            bool signInResult1 = await _connector.SignIn(Identity, true);

            var secondConnector = new AgentConnector()
            {
                Host = _host
            };
            var  secondIdentity = CreateUserIdentity();
            bool signInResult2  = await secondConnector.SignIn(secondIdentity, true);

            //Act
            var result1 = await _connector.Connect();

            var result2 = await secondConnector.Connect();

            //Assert
            Assert.True(signInResult1, "Sign-in first connector failed.");
            Assert.True(signInResult2, "Sign-in second connector failed.");
            Assert.True(result1, "Connect first connector failed.");
            Assert.True(result2, "Connect second connector failed.");

            await _connector.SignOut();

            await secondConnector.SignOut();
        }
Пример #3
0
        public async Task <bool> Connect(string host, int sessionId)
        {
            bool result     = false;
            var  signInData = new UserIdentity()
            {
                Login = $"agent{sessionId}@eltra.ch", Password = "******"
            };

            _connector = new AgentConnector()
            {
                Host = host
            };

            if (await _connector.SignIn(signInData, true))
            {
                var deviceIdentity = new UserIdentity()
                {
                    Login = "******", Password = "******"
                };

                if (!await _connector.Connect(deviceIdentity))
                {
                    Console.WriteLine("uups, no connection, timeout!");
                }
                else
                {
                    result = true;
                }
            }

            return(result);
        }
Пример #4
0
        /// <summary>
        /// Unbind
        /// </summary>
        /// <param name="channel"></param>
        /// <param name="connector"></param>
        /// <returns></returns>
        public static async Task <bool> Unbind(this Channel channel, AgentConnector connector)
        {
            bool result = false;

            if (connector != null)
            {
                result = await connector.UnbindChannel(channel);
            }

            return(result);
        }
Пример #5
0
        public StreemaTest()
        {
            string host = "https://eltra.ch";

            //string host = "http://localhost:5001";

            _connector = new AgentConnector()
            {
                Host = host
            };
        }
Пример #6
0
 public AgentConnectorTestData(AgentConnector connector, UserIdentity identity)
 {
     _connector = connector;
     _identity  = identity;
 }
Пример #7
0
 public RelayVcs(AgentConnector connector, EltraDevice device)
     : base(connector, device)
 {
 }
Пример #8
0
 public VirtualCommandSet CreateVcs(AgentConnector agent, EltraDevice device)
 {
     return(new RelayVcs(agent, device));
 }