public void HasCircularBaseLayoutReference_WithNullItem_ThrowsArgumentNullException() { // Arrange var validator = new BaseLayoutValidator(TestUtil.CreateFakeSettings()); // Act => Assert Assert.Throws<ArgumentNullException>(() => validator.HasCircularBaseLayoutReference(null)); }
public void HasCircularBaseLayoutReference_WithItemWithoutBaseLayoutField_ReturnsFalse() { // Arrange var validator = new BaseLayoutValidator(TestUtil.CreateFakeSettings()); var item = MasterFakesFactory.CreateFakeItem(null, null, null, null, null, false); // Act var result = validator.HasCircularBaseLayoutReference(item); // Assert Assert.False(result); }
public void HasCircularBaseLayoutReference_WithMultiLevelCircularReference_ReturnsTrue() { // Arrange var validator = new BaseLayoutValidator(TestUtil.CreateFakeSettings()); var id = new ID(); var baseId = new ID(); var baseItem = MasterFakesFactory.CreateFakeItem(baseId, null, null, null, id); var item = MasterFakesFactory.CreateFakeItem(id, null, null, null, baseId); // Act var result = validator.HasCircularBaseLayoutReference(item); // Assert Assert.True(result); }