private void InsertMockDataToTable() { _adapter.Insert(TableName, new[] { ColumnChannelName, ColumnLogName }, new List <object[]> { new object[] { StorageTestChannelName, "" } } ); }
public void FailToGetALog() { // Prepare data. StorageAdapter adapter = new StorageAdapter(); adapter.Initialize(_databasePath); var tables = new[] { ColumnIdName, ColumnChannelName, ColumnLogName }; var types = new[] { "INTEGER PRIMARY KEY AUTOINCREMENT", "TEXT NOT NULL", "TEXT NOT NULL" }; adapter.CreateTable(TableName, tables, types); adapter.Insert(TableName, tables, new List<object[]> { new object[] { 100, StorageTestChannelName, "good luck deserializing me!" } }); var storage = new Microsoft.AppCenter.Storage.Storage(adapter, _databasePath); var logs = new List<Log>(); var batchId = storage.GetLogsAsync(StorageTestChannelName, 4, logs).RunNotAsync(); var count = storage.CountLogsAsync(StorageTestChannelName).RunNotAsync(); Assert.IsNull(batchId); Assert.AreEqual(0, logs.Count); Assert.AreEqual(0, count); }