private void TestEqualsWithDifferentCreated() { KeyMeta otherKeyMeta = new KeyMeta(KeyId, created.AddMinutes(3)); Assert.False(keyMeta.Equals(otherKeyMeta)); Assert.False(otherKeyMeta.Equals(keyMeta)); }
private void TestEqualsWithDifferentKeyId() { KeyMeta otherKeyMeta = new KeyMeta("some_other_keyid", created); Assert.False(keyMeta.Equals(otherKeyMeta)); Assert.False(otherKeyMeta.Equals(keyMeta)); }
private void TestHashCodeAndEqualsSymmetric() { KeyMeta otherKeyMeta = new KeyMeta(KeyId, created); Assert.True(keyMeta.GetHashCode() == otherKeyMeta.GetHashCode()); Assert.NotSame(keyMeta, otherKeyMeta); Assert.True(keyMeta.Equals(otherKeyMeta) && otherKeyMeta.Equals(keyMeta)); }
private void TestConstructorRegular() { KeyMeta meta = new KeyMeta(KeyId, created); Assert.NotNull(meta); Assert.Equal(KeyId, meta.KeyId); Assert.Equal(created, meta.Created); }
private void TestConstructorJson() { Asherah.AppEncryption.Util.Json keyMetaJson = new Asherah.AppEncryption.Util.Json(); keyMetaJson.Put("KeyId", KeyId); keyMetaJson.Put("Created", created); KeyMeta meta = new KeyMeta(keyMetaJson); Assert.NotNull(meta); Assert.Equal(KeyId, meta.KeyId); Assert.Equal(created, meta.Created); }
public EnvelopeKeyRecordTest() { // Have to init these in constructor parentCreated = created.AddSeconds(-1); parentKeyMeta = new KeyMeta(ParentKey, parentCreated); }
public KeyMetaTest() { keyMeta = new KeyMeta(KeyId, created); }