public void TestToxEncryptionLoad()
{
var tox1 = new Tox(ToxOptions.Default);
tox1.Name = "Test";
tox1.StatusMessage = "Hey";
var key = new ToxEncryptionKey("heythisisatest");
var data = tox1.GetData(key);
Assert.IsNotNull(data, "Failed to encrypt the Tox data");
Assert.IsTrue(data.IsEncrypted, "We encrypted the data, but toxencryptsave thinks we didn't");
var tox2 = new Tox(ToxOptions.Default, ToxData.FromBytes(data.Bytes), key);
if (tox2.Id != tox1.Id)
Assert.Fail("Failed to load tox data correctly, tox id's don't match");
if (tox2.Name != tox1.Name)
Assert.Fail("Failed to load tox data correctly, names don't match");
if (tox2.StatusMessage != tox1.StatusMessage)
Assert.Fail("Failed to load tox data correctly, status messages don't match");
tox1.Dispose();
tox2.Dispose();
}