Ejemplo n.º 1
0
        public void Key()
        {
            IClientTransactionExtension extension = new SecurityClientTransactionExtension();

            Assert.That(extension.Key, Is.EqualTo(typeof(SecurityClientTransactionExtension).FullName));
            Assert.That(SecurityClientTransactionExtension.DefaultKey, Is.EqualTo(typeof(SecurityClientTransactionExtension).FullName));
        }
Ejemplo n.º 2
0
        public void Serialization()
        {
            var extension             = new SecurityClientTransactionExtension();
            var deserializedExtension = Serializer.SerializeAndDeserialize(extension);

            Assert.That(deserializedExtension, Is.Not.SameAs(extension));
        }
Ejemplo n.º 3
0
        public void SubTransactionInitialize_IgnoresExtensionIfAlreadyExists()
        {
            var subTransaction = ClientTransaction.CreateRootTransaction();

            _testHelper.AddExtension(_extension);

            var existingExtension = new SecurityClientTransactionExtension();

            subTransaction.Extensions.Add(existingExtension);

            _extension.SubTransactionInitialize(_testHelper.Transaction, subTransaction);

            Assert.That(subTransaction.Extensions[_extension.Key], Is.SameAs(existingExtension));
        }
Ejemplo n.º 4
0
        public void TestInterfaceMembers()
        {
            IClientTransactionExtension extension = new SecurityClientTransactionExtension();

            extension.ObjectsLoaded(null, null);
            extension.ObjectDeleted(null, null);
            extension.PropertyValueRead(null, null, null, null, ValueAccess.Current);
            extension.PropertyValueChanged(null, null, null, null, null);
            extension.RelationRead(null, null, null, (ReadOnlyDomainObjectCollectionAdapter <DomainObject>)null, ValueAccess.Current);
            extension.RelationRead(null, null, null, (DomainObject)null, ValueAccess.Current);
            extension.RelationChanged(null, null, null, null, null);
            extension.Committing(null, null, null);
            extension.Committed(null, null);
            extension.RollingBack(null, null);
            extension.RolledBack(null, null);
        }