1
0
mirror of https://github.com/mxpv/podsync.git synced 2024-05-11 05:55:04 +00:00

Rework Redis serialization

This commit is contained in:
Maksym Pavlenko
2017-01-06 17:47:42 -08:00
parent 9164833f4b
commit ab206fb09d
4 changed files with 91 additions and 55 deletions

View File

@@ -29,17 +29,11 @@ namespace Podsync.Tests.Services.Storage
{
const int idCount = 50;
try
{
var results = new string[idCount];
Parallel.For(0, results.Length, (i, _) => results[i] = _storage.MakeId().GetAwaiter().GetResult());
Assert.Equal(results.Length, results.Distinct().Count());
}
finally
{
_storage.ResetCounter();
}
var results = new string[idCount];
Parallel.For(0, results.Length, (i, _) => results[i] = _storage.MakeId().GetAwaiter().GetResult());
Assert.Equal(results.Length, results.Distinct().Count());
}
[Fact]
@@ -49,7 +43,9 @@ namespace Podsync.Tests.Services.Storage
{
Id = "123",
LinkType = LinkType.Channel,
Provider = Provider.Vimeo
Provider = Provider.Vimeo,
PageSize = 45
};
var id = await _storage.Save(feed);
@@ -61,6 +57,7 @@ namespace Podsync.Tests.Services.Storage
Assert.Equal(feed.Id, loaded.Id);
Assert.Equal(feed.LinkType, loaded.LinkType);
Assert.Equal(feed.Provider, loaded.Provider);
Assert.Equal(45, loaded.PageSize);
}
[Fact]