Example #1
0
        public void ConnectorNotFoundByIdDisabled()
        {
            var db = new AppDbContext(appDbOptions);

            db.Connector.Add(new Connector
            {
                Id       = id,
                Name     = "connName1",
                IsActive = false
            });
            db.SaveChanges();

            IAppAdminService appAdminService = new AppAdminService(db);

            _ = appAdminService.GetConnectionById(id);
        }
Example #2
0
        public void FindConnectorById()
        {
            var db    = new AppDbContext(appDbOptions);
            var conn1 = new Connector
            {
                Name     = "connName1",
                IsActive = true
            };

            db.Connector.Add(conn1);
            db.SaveChanges();

            IAppAdminService appAdminService = new AppAdminService(db);
            var connector = appAdminService.GetConnectionById(conn1.Id);

            Assert.AreEqual(conn1.Id, connector.Id);
            Assert.AreEqual("connName1", connector.Name);
        }