Beispiel #1
0
        public void FindPropertyNull()
        {
            string    artIds = "";
            string    catIds = "";
            ArrayList list   = new ArrayList();
            IList     arts   = new ArrayList();

            for (int i = 0; i < 5; i++)
            {
                TCat cat = new TCat();
                cat.Name = "tempCat1";

                cat.insert();

                list.Add(cat);
                catIds += cat.Id + ",";

                TArticle art = new TArticle();
                art.Title = "这是什么地方的测试" + i;
                art.Cat   = cat;

                art.insert();

                arts.Add(art);
                artIds += art.Id + ",";

                cat.delete();
            }
            catIds = catIds.TrimEnd(',');
            artIds = artIds.TrimEnd(',');

            IList <TArticle> results = TArticle.find("Id in (" + artIds + ")").list();

            foreach (TArticle art in results)
            {
                Assert.IsNull(art.Cat);
                Console.WriteLine(art.Title);
                //Console.WriteLine( "Id:" + art.Cat.Id + " catNull:" + art.Cat.IsNull() + " nameNull:" + strUtil.IsNullOrEmpty( art.Cat.Name ) );
            }
        }
Beispiel #2
0
        public void InsertCat()
        {
            ConsoleTitleUtil.ShowTestTitle("InsertCat");


            TCat cat = new TCat();

            cat.Name = "国内新闻";
            cat.insert();

            cat.Name = "国际新闻";
            cat.insert();

            cat.Name = "娱乐电影";
            cat.insert();

            cat.Name = "音像世界";
            cat.insert();

            cat.Name = "游戏广场";
            cat.insert();

            cat.Name = "文学艺术";
            cat.insert();

            cat.Name = "电视剧本";
            cat.insert();

            cat.Name = "武侠小说";
            cat.insert();

            cat.Name = "互联网络";
            cat.insert();

            cat.Name = "软件服务";
            cat.insert();

            cat.Name = "笑话幽默";
            cat.insert();

            cat.Name = "金融期货";
            cat.insert();

            Console.WriteLine("添加 cat 成功!");
        }
Beispiel #3
0
        public void FindPropertyNull()
        {
            string artIds = "";
            string catIds = "";
            ArrayList list = new ArrayList();
            IList arts = new ArrayList();
            for (int i = 0; i < 5; i++) {
                TCat cat = new TCat();
                cat.Name = "tempCat1";

                cat.insert();

                list.Add( cat );
                catIds += cat.Id + ",";

                TArticle art = new TArticle();
                art.Title = "这是什么地方的测试" + i;
                art.Cat = cat;

                art.insert();

                arts.Add( art );
                artIds += art.Id + ",";

                cat.delete();

            }
            catIds = catIds.TrimEnd( ',' );
            artIds = artIds.TrimEnd( ',' );

            IList<TArticle> results = TArticle.find( "Id in (" + artIds + ")" ).list();
            foreach (TArticle art in results) {
                Assert.IsNull( art.Cat );
                Console.WriteLine( art.Title );
                //Console.WriteLine( "Id:" + art.Cat.Id + " catNull:" + art.Cat.IsNull() + " nameNull:" + strUtil.IsNullOrEmpty( art.Cat.Name ) );
            }
        }
Beispiel #4
0
        public void InsertCat()
        {
            ConsoleTitleUtil.ShowTestTitle( "InsertCat" );

            TCat cat = new TCat();
            cat.Name = "国内新闻";
            cat.insert();

            cat.Name = "国际新闻";
            cat.insert();

            cat.Name = "娱乐电影";
            cat.insert();

            cat.Name = "音像世界";
            cat.insert();

            cat.Name = "游戏广场";
            cat.insert();

            cat.Name = "文学艺术";
            cat.insert();

            cat.Name = "电视剧本";
            cat.insert();

            cat.Name = "武侠小说";
            cat.insert();

            cat.Name = "互联网络";
            cat.insert();

            cat.Name = "软件服务";
            cat.insert();

            cat.Name = "笑话幽默";
            cat.insert();

            cat.Name = "金融期货";
            cat.insert();

            Console.WriteLine( "添加 cat 成功!" );
        }
Beispiel #5
0
        public void InsertCat()
        {
            ConsoleTitleUtil.ShowTestTitle( "InsertCat" );

            TCat cat = new TCat();
            cat.Name = "��������";
            cat.insert();

            cat.Name = "��������";
            cat.insert();

            cat.Name = "���ֵ�Ӱ";
            cat.insert();

            cat.Name = "��������";
            cat.insert();

            cat.Name = "��Ϸ�㳡";
            cat.insert();

            cat.Name = "��ѧ����";
            cat.insert();

            cat.Name = "���Ӿ籾";
            cat.insert();

            cat.Name = "����С˵";
            cat.insert();

            cat.Name = "��������";
            cat.insert();

            cat.Name = "�������";
            cat.insert();

            cat.Name = "Ц����Ĭ";
            cat.insert();

            cat.Name = "�����ڻ�";
            cat.insert();

            Console.WriteLine( "��� cat �ɹ���" );
        }