public void Create() { var option = EdnsDAUOption.Create(); Assert.AreEqual(EdnsOptionType.DAU, option.Type); CollectionAssert.AreEqual(SecurityAlgorithmRegistry.Algorithms.Keys, option.Algorithms); }
/// <summary> /// Create a new instance of the <see cref="EdnsDAUOption"/> class with /// the known/implemented security algorithms. /// </summary> /// <remarks> /// The <see cref="Algorithms"/> are obtained from the <see cref="SecurityAlgorithmRegistry"/>. /// </remarks> public static EdnsDAUOption Create() { var option = new EdnsDAUOption(); option.Algorithms.AddRange(SecurityAlgorithmRegistry.Algorithms.Keys); return(option); }
public void Roundtrip() { var opt1 = new OPTRecord(); var expected = new EdnsDAUOption { Algorithms = { SecurityAlgorithm.ED25519, SecurityAlgorithm.ECCGOST } }; Assert.AreEqual(EdnsOptionType.DAU, expected.Type); opt1.Options.Add(expected); var opt2 = (OPTRecord) new ResourceRecord().Read(opt1.ToByteArray()); var actual = (EdnsDAUOption)opt2.Options[0]; Assert.AreEqual(expected.Type, actual.Type); CollectionAssert.AreEqual(expected.Algorithms, actual.Algorithms); }