mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
34 lines
793 B
C#
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);
|
|
|
|
|
|
}
|
|
|
|
}
|
|
}
|