예제 #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());
        }