Skip to content

Commit ffe4995

Browse files
author
Jesper Glintborg
committed
Added more tests.
1 parent 7fa3206 commit ffe4995

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

src/NetMQ.Tests/NetMQCertificateTest.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,31 @@ public void X85()
2121
Assert.Equal(key.PublicKey, copy.PublicKey);
2222
}
2323
}
24+
25+
[Fact]
26+
public void FromPublicKey()
27+
{
28+
var key = new NetMQCertificate();
29+
var copy = NetMQCertificate.FromPublicKey(key.PublicKeyZ85);
30+
31+
Assert.Null(copy.SecretKeyZ85);
32+
Assert.Equal(key.PublicKeyZ85, copy.PublicKeyZ85);
33+
34+
Assert.Null(copy.SecretKey);
35+
Assert.Equal(key.PublicKey, copy.PublicKey);
36+
}
37+
38+
[Fact]
39+
public void FromSecretKey()
40+
{
41+
var key = new NetMQCertificate();
42+
var copy = new NetMQCertificate().FromSecretKey(key.SecretKeyZ85);
43+
44+
Assert.Equal(key.SecretKeyZ85, copy.SecretKeyZ85);
45+
Assert.Equal(key.PublicKeyZ85, copy.PublicKeyZ85);
46+
47+
Assert.Equal(key.SecretKey, copy.SecretKey);
48+
Assert.Equal(key.PublicKey, copy.PublicKey);
49+
}
2450
}
2551
}

0 commit comments

Comments
 (0)