public void LargeByteArray() { const int byteArraySize = 1024 * 1024; var bytes = new byte[byteArraySize]; for (int i = 0; i < byteArraySize; i++) { bytes[i] = (byte)(i % 256); } var byteArray = new ByteArrayClass { bytes = bytes }; var database = new SQLiteConnection(_sqlite3Platform, TestPath.GetTempFileName()); database.CreateTable <ByteArrayClass>(); //Insert the ByteArrayClass database.Insert(byteArray); //Get it back out ByteArrayClass[] fetchedByteArrays = database.Table <ByteArrayClass>().ToArray(); Assert.AreEqual(fetchedByteArrays.Length, 1); //Check they are the same byteArray.AssertEquals(fetchedByteArrays[0]); }
public void LargeByteArray() { const int byteArraySize = 1024 * 1024; byte[] bytes = new byte[byteArraySize]; for (int i = 0; i < byteArraySize; i++) { bytes[i] = (byte)(i % 256); } ByteArrayClass byteArray = new ByteArrayClass() { bytes = bytes }; var db = TestDb.GetMemoryDb(); db.CreateTable <ByteArrayClass>(); //Insert the ByteArrayClass db.Insert(byteArray); //Get it back out ByteArrayClass[] fetchedByteArrays = db.Table <ByteArrayClass>().ToArray(); Assert.AreEqual(fetchedByteArrays.Length, 1); //Check they are the same byteArray.AssertEquals(fetchedByteArrays[0]); }
// [Description("Create A large byte array and check it can be stored and retrieved correctly")] public void LargeByteArrayTest() { const int byteArraySize = 1024 * 1024; var bytes = new byte[byteArraySize]; for (int i = 0; i < byteArraySize; i++) { bytes[i] = (byte)(i % 256); } var byteArray = new ByteArrayClass { Bytes = bytes }; var database = new OrmTestSession(); database.CreateTable <ByteArrayClass>(); //Insert the ByteArrayClass database.Insert(byteArray); //Get it back out ByteArrayClass[] fetchedByteArrays = database.Table <ByteArrayClass>().ToArray(); Assert.AreEqual(fetchedByteArrays.Length, 1); //Check they are the same byteArray.AssertEquals(fetchedByteArrays[0]); }
public void LargeByteArray() { const int byteArraySize = 1024 * 1024; byte[] bytes = new byte[byteArraySize]; for (int i = 0; i < byteArraySize; i++) bytes[i] = (byte)(i % 256); ByteArrayClass byteArray = new ByteArrayClass() { bytes = bytes }; SQLiteConnection database = new SQLiteConnection(TestPath.GetTempFileName()); database.CreateTable<ByteArrayClass>(); //Insert the ByteArrayClass database.Insert(byteArray); //Get it back out ByteArrayClass[] fetchedByteArrays = database.Table<ByteArrayClass>().ToArray(); Assert.AreEqual(fetchedByteArrays.Length, 1); //Check they are the same byteArray.AssertEquals(fetchedByteArrays[0]); }
// [Description("Create A large byte array and check it can be stored and retrieved correctly")] public void LargeByteArrayTest() { const int byteArraySize = 1024 * 1024; var bytes = new byte[byteArraySize]; for (int i = 0; i < byteArraySize; i++) { bytes[i] = (byte)(i % 256); } var byteArray = new ByteArrayClass { Bytes = bytes }; var database = new OrmTestSession(); database.CreateTable<ByteArrayClass>(); //Insert the ByteArrayClass database.Insert(byteArray); //Get it back out ByteArrayClass[] fetchedByteArrays = database.Table<ByteArrayClass>().ToArray(); Assert.AreEqual(fetchedByteArrays.Length, 1); //Check they are the same byteArray.AssertEquals(fetchedByteArrays[0]); }
public void LargeByteArray() { const int byteArraySize = 1024*1024; var bytes = new byte[byteArraySize]; for (int i = 0; i < byteArraySize; i++) { bytes[i] = (byte) (i%256); } var byteArray = new ByteArrayClass { bytes = bytes }; var database = new SQLiteConnection(_sqlite3Platform, TestPath.CreateTemporaryDatabase()); database.CreateTable<ByteArrayClass>(); //Insert the ByteArrayClass database.Insert(byteArray); //Get it back out ByteArrayClass[] fetchedByteArrays = database.Table<ByteArrayClass>().ToArray(); Assert.AreEqual(fetchedByteArrays.Length, 1); //Check they are the same byteArray.AssertEquals(fetchedByteArrays[0]); }