wabbajack/Wabbajack.Common.Test/EncryptedDataTests.cs
2020-05-25 10:24:16 -06:00

34 lines
793 B
C#

using System;
using System.Collections.Concurrent;
using System.Threading.Tasks;
using Xunit;
namespace Wabbajack.Common.Test
{
public class EncryptedDataTests
{
[Fact]
public async Task CanDetectNewEncryptedData()
{
var testString = Guid.NewGuid().ToString();
var data = new ConcurrentBag<string>();
var events = Utils.HaveEncryptedJsonObservable(testString).Subscribe(e =>
{
if (e)
data.Add(testString);
else
data.Clear();
});
await testString.ToEcryptedJson(testString);
await Task.Delay(100);
Assert.Contains(testString, data);
}
}
}