Exemple #1
0
        private async Task ValidateDestination(IAsyncFilesCommands destination)
        {
            var stats = await destination.GetStatisticsAsync();

            Assert.Equal(20, stats.FileCount);

            var headers = await destination.BrowseAsync();

            Assert.Equal(20, headers.Length);

            for (int i = 0; i < 10; i++)
            {
                var metadata = new Reference <RavenJObject>();
                var stream   = await destination.DownloadAsync(SynchronizedFileName(i), metadata);

                Assert.Equal(stream.GetMD5Hash(), CreateUniformFileStream(i, (char)i).GetMD5Hash());

                stream = await destination.DownloadAsync(FileName(i), metadata);

                Assert.Equal(stream.GetMD5Hash(), CreateUniformFileStream(i, (char)i).GetMD5Hash());

                var searchResult = await destination.SearchAsync("ETag:" + metadata.Value[Constants.MetadataEtagField]);

                Assert.Equal(1, searchResult.Files.Count);
                Assert.Equal(1, searchResult.FileCount);

                var config = await destination.Configuration.GetKeyAsync <RavenJObject>(ConfigurationName(i));

                Assert.Equal(string.Format("value-{0}", i), config["key"].ToString());
            }
        }
Exemple #2
0
        private async Task ValidateSource(IAsyncFilesCommands source)
        {
            var stats = await source.GetStatisticsAsync();

            Assert.Equal(10, stats.FileCount);
            Assert.Equal(0, stats.ActiveSyncs.Count);
            Assert.Equal(0, stats.PendingSyncs.Count);

            var headers = await source.BrowseAsync();

            Assert.Equal(10, headers.Length);

            for (int i = 0; i < 10; i++)
            {
                var metadata = new Reference <RavenJObject>();
                var stream   = await source.DownloadAsync(SynchronizedFileName(i), metadata);

                Assert.Equal(stream.GetMD5Hash(), CreateUniformFileStream(i, (char)i).GetMD5Hash());
            }

            var search = await source.SearchAsync("");

            Assert.Equal(10, search.Files.Count);
            Assert.Equal(10, search.FileCount);
        }
Exemple #3
0
		private async Task ValidateDestination(IAsyncFilesCommands destination)
		{
			var stats = await destination.GetStatisticsAsync();

			Assert.Equal(20, stats.FileCount);

			var headers = await destination.BrowseAsync();
			Assert.Equal(20, headers.Length);

			for (int i = 0; i < 10; i++)
			{
				var metadata = new Reference<RavenJObject>();
				var stream = await destination.DownloadAsync(SynchronizedFileName(i), metadata);

				Assert.Equal(stream.GetMD5Hash(), CreateUniformFileStream(i, (char) i).GetMD5Hash());

				stream = await destination.DownloadAsync(FileName(i), metadata);

				Assert.Equal(stream.GetMD5Hash(), CreateUniformFileStream(i, (char) i).GetMD5Hash());

				var searchResult = await destination.SearchAsync("ETag:" + metadata.Value[Constants.MetadataEtagField]);

				Assert.Equal(1, searchResult.Files.Count);
				Assert.Equal(1, searchResult.FileCount);

				var config = await destination.Configuration.GetKeyAsync<RavenJObject>(ConfigurationName(i));

				Assert.Equal(string.Format("value-{0}", i), config["key"].ToString());
			}
		}
Exemple #4
0
		private async Task ValidateSource(IAsyncFilesCommands source)
		{
			var stats = await source.GetStatisticsAsync();

			Assert.Equal(10, stats.FileCount);
			Assert.Equal(0, stats.ActiveSyncs.Count);
			Assert.Equal(0, stats.PendingSyncs.Count);

			var headers = await source.BrowseAsync();
			Assert.Equal(10, headers.Length);

			for (int i = 0; i < 10; i++)
			{
				var metadata = new Reference<RavenJObject>();
				var stream = await source.DownloadAsync(SynchronizedFileName(i), metadata);

				Assert.Equal(stream.GetMD5Hash(), CreateUniformFileStream(i, (char) i).GetMD5Hash());
			}

			var search = await source.SearchAsync("");
			Assert.Equal(10, search.Files.Count);
			Assert.Equal(10, search.FileCount);
		}