Beispiel #1
0
        public void LazyChildrenChildrenAccessThrowErrorIfNoParentAttached(IList <IMetadataObject> values)
        {
            // Act
            var sut = new LazyChildren <IMetadataObject>(values.ToImmutableList());

            // Assert
            Assert.Throws <NotSupportedException>(() => sut.GetEnumerator());
        }
Beispiel #2
0
        public void LazyChildrenThrowsErrorIfLambdaReturnsNull(IMetadataObject parent)
        {
            // Act
            var sut = new LazyChildren <IMetadataObject>(_ => null);

            sut.AttachToParent(parent);

            // Assert
            Assert.Throws <NotSupportedException>(() => sut.GetEnumerator());
        }