コード例 #1
0
        public void OnBeforeObjectRegistration_WithoutParent()
        {
            Assert.That(_managerWithoutParent.ReadOnlyClientTransactionListener.CurrentlyLoadingObjectIDs, Is.Empty);

            _managerWithoutParent.OnBeforeObjectRegistration(Array.AsReadOnly(new[] { DomainObjectIDs.Order1, DomainObjectIDs.Order3 }));

            Assert.That(
                _managerWithoutParent.ReadOnlyClientTransactionListener.CurrentlyLoadingObjectIDs,
                Is.EquivalentTo(new[] { DomainObjectIDs.Order1, DomainObjectIDs.Order3 }));

            _managerWithoutParent.OnBeforeObjectRegistration(Array.AsReadOnly(new[] { DomainObjectIDs.Order4 }));

            Assert.That(
                _managerWithoutParent.ReadOnlyClientTransactionListener.CurrentlyLoadingObjectIDs,
                Is.EquivalentTo(new[] { DomainObjectIDs.Order1, DomainObjectIDs.Order3, DomainObjectIDs.Order4 }));
        }
コード例 #2
0
        public void OnBeforeObjectRegistration_WithParent()
        {
            Assert.That(_manager.ReadOnlyClientTransactionListener.CurrentlyLoadingObjectIDs, Is.Empty);

            _parentHierarchyManagerStrictMock
            .Expect(mock => mock.OnBeforeSubTransactionObjectRegistration(new[] { DomainObjectIDs.Order1, DomainObjectIDs.Order3 }))
            .WhenCalled(mi => Assert.That(_manager.ReadOnlyClientTransactionListener.CurrentlyLoadingObjectIDs, Is.Empty));

            _manager.OnBeforeObjectRegistration(Array.AsReadOnly(new[] { DomainObjectIDs.Order1, DomainObjectIDs.Order3 }));

            _parentHierarchyManagerStrictMock.VerifyAllExpectations();
            Assert.That(
                _manager.ReadOnlyClientTransactionListener.CurrentlyLoadingObjectIDs,
                Is.EquivalentTo(new[] { DomainObjectIDs.Order1, DomainObjectIDs.Order3 }));
        }