wabbajack/Wabbajack.Test/EncryptedDataTests.cs

38 lines
937 B
C#
Raw Normal View History

2020-02-11 00:30:38 +00:00
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Wabbajack.Common;
namespace Wabbajack.Test
{
2020-02-11 00:30:38 +00:00
[TestClass]
public class EncryptedDataTests
{
2020-02-11 00:30:38 +00:00
[TestMethod]
public async Task CanDetectNewEncryptedData()
{
var test_string = Guid.NewGuid().ToString();
var data = new ConcurrentBag<string>();
var events = Utils.HaveEncryptedJsonObservable(test_string).Subscribe(e =>
{
if (e)
data.Add(test_string);
else
data.Clear();
});
test_string.ToEcryptedJson(test_string);
await Task.Delay(100);
CollectionAssert.Contains(data, test_string);
}
}
}