Пример #1
0
        public void TestExtractionFilterDeleting_WhenItHas_ExtractionFilterParameterSet_Interactive()
        {
            var filter = WhenIHaveA <ExtractionFilter>();

            var set = new ExtractionFilterParameterSet(Repository, filter, "fff");

            Assert.IsTrue(filter.Exists());
            Assert.IsTrue(set.Exists());

            var activator = new TestActivateItems(this, Repository);

            activator.InteractiveDeletes = true;
            activator.YesNoResponse      = true;

            var del = new ExecuteCommandDelete(activator, filter);

            del.Execute();

            Assert.IsFalse(filter.Exists());
            Assert.IsFalse(set.Exists());
        }
Пример #2
0
        public void ExtractionFilterParameterSet_Deleting()
        {
            var cata     = new Catalogue(CatalogueRepository, "myCata");
            var cataItem = new CatalogueItem(CatalogueRepository, cata, "MyCol");

            var table = new TableInfo(CatalogueRepository, "myTbl");
            var col   = new ColumnInfo(CatalogueRepository, "myCol", "varchar(10)", table);

            var ei     = new ExtractionInformation(CatalogueRepository, cataItem, col, "[myTbl].[mycol]");
            var filter = new ExtractionFilter(CatalogueRepository, "Age", ei);

            filter.WhereSQL = "Age >= @age";
            new ExtractionFilterParameter(CatalogueRepository, "DECLARE @age int", filter);

            var paramSet = new ExtractionFilterParameterSet(CatalogueRepository, filter, "Old");
            var vals     = paramSet.CreateNewValueEntries();

            Assert.AreEqual(1, vals.Length);
            Assert.IsTrue(vals[0].Exists());

            paramSet.DeleteInDatabase();
            Assert.IsFalse(paramSet.Exists());
            Assert.IsFalse(vals[0].Exists());
        }