public void LookupManager_Get_SelectALookupEntityByIdUsingAltConnectionName_RetrievedSuccessfully()
        {
            ILookupManager <BusinessTypeCC2> manager = new BusinessTypeCC2Manager();

            var all    = manager.Get(true);
            var result = manager.Get(all[0].Id, "Other");

            Assert.IsTrue(result.Id > 0);
            Assert.IsTrue(!string.IsNullOrWhiteSpace(result.Name));
            Assert.IsTrue(!string.IsNullOrWhiteSpace(result.Description));
            Assert.IsTrue(!string.IsNullOrWhiteSpace(result.Code));
        }
        public void LookupManager_Update_UpdateALookupEntity_UpdatedSuccessfully()
        {
            ILookupManager <BusinessTypeCC2> manager = new BusinessTypeCC2Manager();

            var t = manager.Create(new BusinessTypeCC2()
            {
                Name        = "Some Business",
                Description = "Some Business Description",
                Code        = "SOMEBIZ1818",
                Active      = true
            });

            Assert.IsTrue(t);

            var all = manager.Get(false);

            var result =
                manager.Update(new BusinessTypeCC2()
            {
                Id          = all[0].Id,
                Name        = "Some Other Business",
                Description = "Some Business Description 24",
                Code        = "SOMEBIZ4546",
                Active      = false
            });

            Assert.IsTrue(result);
        }
        public void LookupManager_Update_UpdateALookupEntity_UpdatedSuccessfully()
        {
            ILookupManager<BusinessTypeCC2> manager = new BusinessTypeCC2Manager();

            var t = manager.Create(new BusinessTypeCC2()
            {
                Name = "Some Business",
                Description = "Some Business Description",
                Code = "SOMEBIZ1818",
                Active = true
            });

            Assert.IsTrue(t);

            var all = manager.Get(false);

            var result =
                manager.Update(new BusinessTypeCC2()
                    {
                        Id = all[0].Id,
                        Name = "Some Other Business",
                        Description = "Some Business Description 24",
                        Code = "SOMEBIZ4546",
                        Active = false
                    });

            Assert.IsTrue(result);
        }
        public void LookupManager_Get_SelectLookupEntitiesByIdsUsingAltConnectionName_RetrievedSuccessfully()
        {
            ILookupManager <BusinessTypeCC2> manager = new BusinessTypeCC2Manager();

            var all    = manager.Get(true);
            var result = manager.Get(all.Select(o => o.Id).ToList(), "Other");

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count > 0);

            foreach (var r in result)
            {
                Assert.IsTrue(r.Id > 0);
                Assert.IsTrue(!string.IsNullOrWhiteSpace(r.Name));
                Assert.IsTrue(!string.IsNullOrWhiteSpace(r.Description));
                Assert.IsTrue(!string.IsNullOrWhiteSpace(r.Code));
                Assert.IsTrue(r.Active);
            }
        }
        public void LookupManager_Get_SelectAllLookups_RetrievedSuccessfully()
        {
            ILookupManager<BusinessTypeCC2> manager = new BusinessTypeCC2Manager();

            var result = manager.Get(false);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count > 0);

            foreach (var r in result)
            {
                Assert.IsTrue(r.Id > 0);
                Assert.IsTrue(!string.IsNullOrWhiteSpace(r.Name));
                Assert.IsTrue(!string.IsNullOrWhiteSpace(r.Description));
                Assert.IsTrue(!string.IsNullOrWhiteSpace(r.Code));
            }
        }
        public void LookupManager_Get_SelectAllLookupsUsingAltConnectionName_RetrievedSuccessfully()
        {
            ILookupManager <BusinessTypeCC2> manager = new BusinessTypeCC2Manager();

            var result = manager.Get(false, "Other");

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count > 0);

            foreach (var r in result)
            {
                Assert.IsTrue(r.Id > 0);
                Assert.IsTrue(!string.IsNullOrWhiteSpace(r.Name));
                Assert.IsTrue(!string.IsNullOrWhiteSpace(r.Description));
                Assert.IsTrue(!string.IsNullOrWhiteSpace(r.Code));
            }
        }
        public void LookupManager_Delete_DeleteALookupEntityByCodeUsingAltConnectionName_DeletedSuccessfully()
        {
            ILookupManager<BusinessTypeCC2> manager = new BusinessTypeCC2Manager();

            var t = manager.Create(new BusinessTypeCC2()
            {
                Name = "Some Business",
                Description = "Some Business Description",
                Code = "SOMEBIZ9898",
                Active = true
            });

            Assert.IsTrue(t);
            var all = manager.Get(false);

            var result = manager.Delete("SOMEBIZ9898", "Other");

            Assert.IsTrue(result);
        }
        public void LookupManager_Delete_DeleteALookupEntityByCodeUsingAltConnectionName_DeletedSuccessfully()
        {
            ILookupManager <BusinessTypeCC2> manager = new BusinessTypeCC2Manager();

            var t = manager.Create(new BusinessTypeCC2()
            {
                Name        = "Some Business",
                Description = "Some Business Description",
                Code        = "SOMEBIZ9898",
                Active      = true
            });

            Assert.IsTrue(t);
            var all = manager.Get(false);

            var result = manager.Delete("SOMEBIZ9898", "Other");

            Assert.IsTrue(result);
        }
        public void LookupManager_Delete_DeleteALookupEntityByCodes_DeletedSuccessfully()
        {
            ILookupManager<BusinessTypeCC2> manager = new BusinessTypeCC2Manager();

            var t = manager.Create(new BusinessTypeCC2()
            {
                Name = "Some Business",
                Description = "Some Business Description",
                Code = "SOMEBIZ2424",
                Active = true
            });

            Assert.IsTrue(t);

            var all = manager.Get(false);

            var result = manager.Delete(new List<string>() { "SOMEBIZ2424" });

            Assert.IsTrue(result);
        }
        public void LookupManager_Delete_DeleteALookupEntityByIds_DeletedSuccessfully()
        {
            ILookupManager <BusinessTypeCC2> manager = new BusinessTypeCC2Manager();

            var t = manager.Create(new BusinessTypeCC2()
            {
                Name        = "Some Business",
                Description = "Some Business Description",
                Code        = "SOMEBIZ1717",
                Active      = true
            });

            Assert.IsTrue(t);

            var all = manager.Get(false);

            var result = manager.Delete(all.Select(d => d.Id).Take(1).ToList());

            Assert.IsTrue(result);
        }
        public void LookupManager_Delete_DeleteALookupEntityByCodes_DeletedSuccessfully()
        {
            ILookupManager <BusinessTypeCC2> manager = new BusinessTypeCC2Manager();

            var t = manager.Create(new BusinessTypeCC2()
            {
                Name        = "Some Business",
                Description = "Some Business Description",
                Code        = "SOMEBIZ2424",
                Active      = true
            });

            Assert.IsTrue(t);

            var all = manager.Get(false);

            var result = manager.Delete(new List <string>()
            {
                "SOMEBIZ2424"
            });

            Assert.IsTrue(result);
        }
        public void LookupManager_Delete_DeleteALookupEntityByIds_DeletedSuccessfully()
        {
            ILookupManager<BusinessTypeCC2> manager = new BusinessTypeCC2Manager();

            var t = manager.Create(new BusinessTypeCC2()
                {
                    Name = "Some Business",
                    Description = "Some Business Description",
                    Code = "SOMEBIZ1717",
                    Active = true
                });

            Assert.IsTrue(t);

            var all = manager.Get(false);

            var result = manager.Delete(all.Select(d => d.Id).Take(1).ToList());

            Assert.IsTrue(result);
        }
        public void LookupManager_Get_SelectALookupEntityByCodeUsingAltConnectionName_RetrievedSuccessfully()
        {
            ILookupManager<BusinessTypeCC2> manager = new BusinessTypeCC2Manager();

            var all = manager.Get(true);
            var result = manager.Get(all[0].Code, "Other");

            Assert.IsTrue(result.Id > 0);
            Assert.IsTrue(!string.IsNullOrWhiteSpace(result.Name));
            Assert.IsTrue(!string.IsNullOrWhiteSpace(result.Description));
            Assert.IsTrue(!string.IsNullOrWhiteSpace(result.Code));
            Assert.IsTrue(result.Active);
        }
        public void LookupManager_Get_SelectLookupEntitiesByIds_RetrievedSuccessfully()
        {
            ILookupManager<BusinessTypeCC2> manager = new BusinessTypeCC2Manager();

            var all = manager.Get(true);
            var result = manager.Get(all.Select(o => o.Id).ToList());

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Count > 0);

            foreach (var r in result)
            {
                Assert.IsTrue(r.Id > 0);
                Assert.IsTrue(!string.IsNullOrWhiteSpace(r.Name));
                Assert.IsTrue(!string.IsNullOrWhiteSpace(r.Description));
                Assert.IsTrue(!string.IsNullOrWhiteSpace(r.Code));
                Assert.IsTrue(r.Active);
            }
        }