Beispiel #1
0
        public void ConnectorNotFound()
        {
            var db = new AppDbContext(appDbOptions);

            db.Connector.Add(new Connector
            {
                Name = "connName1"
            });
            db.SaveChanges();

            IAppAdminService appAdminService = new AppAdminService(db);

            _ = appAdminService.GetConnection("connName123");
        }
Beispiel #2
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);
        }
Beispiel #3
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);
        }