コード例 #1
0
        public void LookupManager_Delete_DeleteALookupEntityByInvalidId_ReturnsFalse()
        {
            ILookupManager <BusinessTypeCC2> manager = new BusinessTypeCC2Manager();

            var result = manager.Delete(-495);

            Assert.IsFalse(result);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        public void LookupManager_Delete_DeleteALookupEntityByInvalidId_ReturnsFalse()
        {
            ILookupManager<BusinessTypeCC2> manager = new BusinessTypeCC2Manager();

            var result = manager.Delete(-495);

            Assert.IsFalse(result);
        }
コード例 #8
0
        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);
        }