public void TestWithPreExchangedKeys()
{
Timer t = new Timer(Timeout, null, 0, 500);
int spi = 123333;
new SecurityPolicy(spi, "Rijndael", "SHA1", true);
PeerSecOverlord so0 = CreateValidSO("valid0");
PeerSecOverlord so1 = CreateValidSO("valid1");
MockSender ms0 = new MockSender(null, null, so1, 0);
MockSender ms1 = new MockSender(ms0, null, so0, 0);
ms0.ReturnPath = ms1;
SecurityAssociation sa0 = so0.CreateSecurityAssociation(ms0, spi);
Assert.IsFalse((sa0 as PeerSecAssociation).Start(), "Cannot start SA again");
SecurityAssociation sa1 = so1.CreateSecurityAssociation(ms1, spi);
Assert.AreEqual(sa0.State, SecurityAssociation.States.Active, "sa0 should be active!");
Assert.AreEqual(sa1.State, SecurityAssociation.States.Active, "sa1 should be active!");
Assert.AreEqual(so0.SACount, 1, "so0 should contain just one!");
Assert.AreEqual(so1.SACount, 1, "so1 should contain just one!");
t.Dispose();
}