Ejemplo n.º 1
0
        public void SmugglerExport_with_error_in_stream_should_fail_gracefully()
        {
            using (var counterStore = NewRemoteCountersStore("store"))
                using (var stream = new FailingStream())
                {
                    var smugglerApi = new SmugglerCounterApi();

                    Assert.Throws <FailingStreamException>(() => AsyncHelpers.RunSync(() => smugglerApi.ExportData(new SmugglerExportOptions <CounterConnectionStringOptions>
                    {
                        ToStream = stream,
                        From     = ConnectionStringTo(counterStore)
                    })));
                }
        }
Ejemplo n.º 2
0
        public void SmugglerImport_with_error_in_stream_should_fail_gracefully()
        {
            using (var counterStore = NewRemoteCountersStore("store"))
                using (var stream = new FailingStream())
                {
                    var smugglerApi = new SmugglerCounterApi();

                    Assert.Throws <FailingStreamException>(() => AsyncHelpers.RunSync(() => smugglerApi.ImportData(new SmugglerImportOptions <CounterConnectionStringOptions>
                    {
                        FromStream = stream,
                        To         = new CounterConnectionStringOptions
                        {
                            Url            = counterStore.Url,
                            CounterStoreId = counterStore.Name
                        }
                    })));
                }
        }