예제 #1
0
        private async Task TestUpdate(ISQLiteClient client)
        {
            var note = new Note {
                Id = 1, Content = "Updated content", LastUpdated = DateTime.Now
            };
            await client.UpdateAsync(note);

            var result = await client.GetAsync(1);

            Assert.AreEqual(note.Content, result.Content);
        }
예제 #2
0
        private async Task TestInsert(ISQLiteClient client)
        {
            var note1 = new Note {
                Content = "IntegrationTest1", LastUpdated = DateTime.Now
            };
            var note2 = new Note {
                Content = "IntegrationTest2", LastUpdated = DateTime.Now
            };

            var resultingId1 = await client.InsertAsync(note1);

            var resultingId2 = await client.InsertAsync(note2);

            Assert.AreEqual(1, resultingId1.Id);
            Assert.AreEqual(2, resultingId2.Id);
        }
예제 #3
0
        private async Task TestGet(ISQLiteClient client)
        {
            var result = await client.GetAsync();

            Assert.IsTrue(result.Count() == 2);
        }
예제 #4
0
        private async Task TestGet(ISQLiteClient client, int id)
        {
            var result = await client.GetAsync(id);

            Assert.AreEqual(id, result.Id);
        }