Example #1
0
        public void HasCircularBaseLayoutReference_WithNullItem_ThrowsArgumentNullException()
        {
            // Arrange
            var validator = new BaseLayoutValidator(TestUtil.CreateFakeSettings());

            // Act => Assert
            Assert.Throws <ArgumentNullException>(() => validator.HasCircularBaseLayoutReference(null));
        }
Example #2
0
        public void HasCircularBaseLayoutReference_WithItemWithNoBaseLayout_ReturnsFalse()
        {
            // Arrange
            var validator = new BaseLayoutValidator(TestUtil.CreateFakeSettings());
            var item      = MasterFakesFactory.CreateFakeItem();

            // Act
            var result = validator.HasCircularBaseLayoutReference(item);

            // Assert
            Assert.False(result);
        }
Example #3
0
        public void HasCircularBaseLayoutReference_WithSelfReference_ReturnsTrue()
        {
            // Arrange
            var validator = new BaseLayoutValidator(TestUtil.CreateFakeSettings());
            var id        = new ID();
            var item      = MasterFakesFactory.CreateFakeItem(id, null, null, null, id);

            // Act
            var result = validator.HasCircularBaseLayoutReference(item);

            // Assert
            Assert.True(result);
        }