コード例 #1
0
        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);
        }
コード例 #2
0
        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());
        }
コード例 #3
0
        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());
        }