Ejemplo n.º 1
0
        public void Test()
        {
            ProcedureDatabase db;

            db = new ProcedureDatabase(typeof(ALinq.Oracle.Odp.OracleProvider));
            int count;

            db.GetCategoriesCount(out count);
            Assert.AreEqual(db.Categories.Count(), count);

            var    id = db.Categories.Max(o => o.CategoryID);
            string name;

            db.GetCategoryName(id, out name);
            Assert.AreEqual(db.Categories.Where(o => o.CategoryID == id).Single().CategoryName, name);

            OracleRefCursor myrc;

            db.Connection.Open();
            db.GetAllCategories(out myrc);
            var reader = myrc.GetDataReader();
            IEnumerable <Category> categories = db.Translate <Category>(reader).ToArray();

            Assert.AreEqual(db.Categories.Count(), categories.Count());
            db.Connection.Close();

            categories = db.GetAllCategories();
            Assert.AreEqual(db.Categories.Count(), categories.Count());
        }
Ejemplo n.º 2
0
        public void GetAllCategories()
        {
            var    db = new ProcedureDatabase();
            object myrc;
            var    items = db.GetAllCategories(out myrc);

            Assert.AreEqual(db.Categories.Count(), items.Count());
        }
Ejemplo n.º 3
0
        public void GetAllCategories()
        {
            var    db = new ProcedureDatabase();
            string categoryName, categoryDescription;
            int    categoryID;
            var    items = db.GetAllCategories(out categoryID, out categoryName, out categoryDescription);

            Assert.AreEqual(db.Categories.Count(), items.Count());
        }