public void Should_be_able_to_serialize_to_proper_form() { var expected = "Domain: " + domain + "\n"; expected += "OwnerName: " + ownerName + "\n"; expected += "Issued: " + issued + "\n"; expected += "Expires: " + expires + "\n"; expected += "Features: " + featureOne + "," + featureTwo + "," + featureThree + "\n"; var serializedDomainLicense = domainLicense.SerializeUnencrypted(); serializedDomainLicense.ShouldEqual(expected); }
public void Should_be_able_to_encrypt_and_decrypt() { var keyPair = Helpers.GenerateKeyPairXml(); byte[] encrypted = domainLicense.SerializeAndEncrypt(keyPair); var encryptedDomainLicense = new DomainLicense(encrypted, keyPair); var serializedDomainLicense = encryptedDomainLicense.SerializeUnencrypted(); serializedDomainLicense.ShouldEqual(domainLicense.SerializeUnencrypted()); }