PageRenderTime 47ms CodeModel.GetById 12ms RepoModel.GetById 1ms app.codeStats 0ms

/Raven.Tests.TimeSeries/SmugglerTests.cs

http://github.com/ayende/ravendb
C# | 43 lines | 0 code | 0 blank | 43 comment | 0 complexity | e208e36115cc9b6beefa3e68e5c60303 MD5 | raw file
Possible License(s): GPL-3.0, MPL-2.0-no-copyleft-exception, LGPL-2.1, Apache-2.0, BSD-3-Clause, CC-BY-SA-3.0
  1. /*
  2. using System.IO;
  3. using System.Threading.Tasks;
  4. using FluentAssertions;
  5. using Raven.Abstractions.Data;
  6. using Raven.Abstractions.Smuggler;
  7. using Raven.Database.Extensions;
  8. using Raven.Database.Smuggler;
  9. using Xunit;
  10. namespace Raven.Tests.TimeSeries
  11. {
  12. public class SmugglerTests : RavenBaseTimeSeriesTest
  13. {
  14. private const string TimeSeriesDumpFilename = "testTimeSeries.timeseriesdump";
  15. [Fact]
  16. public async Task SmugglerExport_should_work()
  17. {
  18. IOExtensions.DeleteFile(TimeSeriesDumpFilename);
  19. using (var timeSeriesStore = NewRemoteTimeSeriesStore("store"))
  20. {
  21. await timeSeriesStore.ChangeAsync("g1", "c1", 5);
  22. await timeSeriesStore.IncrementAsync("g1", "c1");
  23. await timeSeriesStore.IncrementAsync("g1", "c2");
  24. await timeSeriesStore.IncrementAsync("g2", "c1");
  25. var smugglerApi = new SmugglerTimeSeriesApi(timeSeriesStore);
  26. await smugglerApi.ExportData(new SmugglerExportOptions<TimeSeriesConnectionStringOptions>
  27. {
  28. ToFile = TimeSeriesDumpFilename
  29. });
  30. var fileInfo = new FileInfo(TimeSeriesDumpFilename);
  31. fileInfo.Exists.Should().BeTrue();
  32. fileInfo.Length.Should().BeGreaterThan(0);
  33. }
  34. }
  35. }
  36. }
  37. */