コード例 #1
0
        public async Task StoreAsync_NoDataRows()
        {
            var sample = SetupData();

            sample.SampleData.Clear();

            using (var store = new SampleStore())
            {
                try
                {
                    await store.Setup(true);

                    await store.StoreSample(sample);
                }
                finally
                {
                    store.Destroy();
                }
            }
        }
コード例 #2
0
        public async Task StoreAsync_ThenList()
        {
            var sample = SetupData();

            using (var store = new SampleStore())
            {
                try
                {
                    await store.Setup(true);

                    await store.StoreSample(sample);

                    var samples = store.ListSamples().ToList();

                    Assert.That(samples.Any(s => s.Id == sample.Id));
                }
                finally
                {
                    store.Destroy();
                }
            }
        }
コード例 #3
0
        public async Task StoreAsync_ExampleDataRows_ThenRetrieve()
        {
            var sample = SetupData();

            using (var store = new SampleStore())
            {
                try
                {
                    await store.Setup(true);

                    var uri = await store.StoreSample(sample);

                    var sample2 = await store.RetrieveSample(uri);

                    Assert.That(sample2, Is.Not.Null);

                }
                finally
                {
                    store.Destroy();
                }
            }
        }