Exemplo n.º 1
0
        public void It_Returns_The_IKey_Objects()
        {
            ProviderInfo info = new ProviderInfo();

            var table1 = new Table();
            var index1 = new Key("1");

            table1.AddKey(index1);
            var table2 = new Table();
            var index2 = new Key("2");

            table2.AddKey(index2);
            info.MappingSet.Database.AddTable(table1);
            info.MappingSet.Database.AddTable(table2);

            IEnumerable <IScriptBaseObject> objects = info.GetAllObjectsOfType(typeof(IKey));

            Assert.That(objects, Has.Length(2));
            Assert.That(objects.Contains(index1));
            Assert.That(objects.Contains(index2));
        }
        public void It_Returns_The_IKey_Objects()
        {
            ProviderInfo info = new ProviderInfo();

            var table1 = new Table();
            var index1 = new Key("1");
            table1.AddKey(index1);
            var table2 = new Table();
            var index2 = new Key("2");
            table2.AddKey(index2);
            info.MappingSet.Database.AddTable(table1);
            info.MappingSet.Database.AddTable(table2);

            IEnumerable<IScriptBaseObject> objects = info.GetAllObjectsOfType(typeof(IKey));

            Assert.That(objects, Has.Length(2));
            Assert.That(objects.Contains(index1));
            Assert.That(objects.Contains(index2));
        }