public void initData()
 {
     Console.WriteLine( "------------------------------init data-------------------------------" );
     for (int i = 0; i < 10; i++) {
         Book book = new Book();
         book.Name = "zhangsan" + (i + 1);
         book.Weather = "hao" + ((i + 1) * 2);
         book.insert();
     }
 }
Exemple #2
0
 public void initData()
 {
     Console.WriteLine("------------------------------init data-------------------------------");
     for (int i = 0; i < 10; i++)
     {
         Book book = new Book();
         book.Name    = "zhangsan" + (i + 1);
         book.Weather = "hao" + ((i + 1) * 2);
         book.insert();
     }
 }
Exemple #3
0
        public void testFindBy_Insert()
        {
            Book newBook = new Book {
                Name    = "zhangsan5",
                Weather = "hao6"
            };

            newBook.insert();

            IList newBooks = new Book().findBy("Name", "zhangsan5");

            Assert.AreEqual(2, newBooks.Count);
            Assert.AreEqual("hao6", ((Book)newBooks[1]).Weather);

            IList newBooks2 = new Book().findBy("Weather", "hao6");

            Assert.AreEqual(2, newBooks2.Count);
            Assert.AreEqual("zhangsan5", ((Book)newBooks2[1]).Name);
        }
        public void testFindBy_Insert()
        {
            Book newBook = new Book {
                Name = "zhangsan5",
                Weather = "hao6"
            };
            newBook.insert();

            IList newBooks = new Book().findBy( "Name", "zhangsan5" );
            Assert.AreEqual( 2, newBooks.Count );
            Assert.AreEqual( "hao6", ((Book)newBooks[1]).Weather );

            IList newBooks2 = new Book().findBy( "Weather", "hao6" );
            Assert.AreEqual( 2, newBooks2.Count );
            Assert.AreEqual( "zhangsan5", ((Book)newBooks2[1]).Name );
        }