private void btn_set_fa_Click(object sender, EventArgs e)
        {
            string fip   = tbox_fa_ip.Text;
            int    fport = int.Parse(tbox_fa_port.Text);

            fc = new FactoryClient(fip, fport);
        }
Example #2
0
        public ConsumerHostServices(IConfiguration configuration, ISaveData saveData, IHostApplicationLifetime appLifetime, ILogger <ConsumerHostServices> logger)
        {
            _logger      = logger;
            _appLifetime = appLifetime;
            IFactoryClient factory = new FactoryClient(configuration, saveData, _logger);

            _client = factory.CreateMessageQueue(configuration["MessageQueue:Type"]);
        }
        public EntityClient Get(int Id)
        {
            var data = base.DataContext.Client.Where(p => p.PK_ClientID == Id);

            if (data.Count() == 1)
            {
                return(FactoryClient.Get(data.Single()));
            }
            else
            {
                return(null);
            }
        }
        public EntityClient GetByClientID(string ClientID)
        {
            var data = base.DataContext.Client.Where(p => p.ClientID == ClientID);

            if (data.Count() == 1)
            {
                return(FactoryClient.Get(data.Single()));
            }
            else
            {
                return(null);
            }
        }
Example #5
0
        public void CreateMessageQueue_StateUnderTest_ExpectedBehavior(string type, string typeName)
        {
            //Arrange
            Mock <IConfiguration> config = _mockRepository.Create <IConfiguration>();
            string connectString         = _fixture.Create <string>();
            string queueName             = _fixture.Create <string>();

            config.Setup(x => x[$"{type}:ConnectionString"]).Returns(connectString);
            config.Setup(x => x[$"{type}:QueueName"]).Returns(queueName);
            var factory = new FactoryClient(config.Object);
            //Act
            var result = factory.CreateMessageQueue(type);

            //Assert
            Assert.StartsWith(typeName, result.GetType().Name);
            this._mockRepository.VerifyAll();
        }
 public List <EntityClient> GetAll()
 {
     return(FactoryClient.GetList(base.DataContext.Client.ToList()));
 }
 public List <EntityClient> GetActives()
 {
     return(FactoryClient.GetList(base.DataContext.Client.Where(p => p.Status == true).ToList()));
 }