public void CreatesCircularBaseLayoutReference_WithLinearChain_ReturnsFalse() { // Arrange var validator = new BaseLayoutValidator(TestUtil.CreateFakeSettings()); var item = MasterFakesFactory.CreateFakeItem(); var item2 = MasterFakesFactory.CreateFakeItem(); var item3 = MasterFakesFactory.CreateFakeItem(null, null, null, null, item2.ID); // Act var result = validator.CreatesCircularBaseLayoutReference(item, item3); // Assert Assert.False(result); }
public void CreatesCircularBaseLayoutReference_WhenBaseLayoutItemHasItemSelectedAsBaseLayout_ReturnsTrue() { // Arrange var validator = new BaseLayoutValidator(TestUtil.CreateFakeSettings()); var item = MasterFakesFactory.CreateFakeItem(); var item2 = MasterFakesFactory.CreateFakeItem(null, null, null, null, item.ID); // Act var result = validator.CreatesCircularBaseLayoutReference(item, item2); // Assert Assert.True(result); }
public void CreatesCircularBaseLayoutReference_WithItemWithoutBaseLayoutField_ThrowsArgumentException() { // Arrange var validator = new BaseLayoutValidator(TestUtil.CreateFakeSettings()); // Act => Assert Assert.Throws<ArgumentException>( () => validator.CreatesCircularBaseLayoutReference( MasterFakesFactory.CreateFakeItem(null, null, null, null, null, false), MasterFakesFactory.CreateFakeItem())); }
public void CreatesCircularBaseLayoutReference_WithItemSameAsBaseLayoutItem_ReturnsTrue() { // Arrange var validator = new BaseLayoutValidator(TestUtil.CreateFakeSettings()); var item = MasterFakesFactory.CreateFakeItem(); // Act var result = validator.CreatesCircularBaseLayoutReference(item, item); // Assert Assert.True(result); }
public void CreatesCircularBaseLayoutReference_WithNullBaseLayoutItem_ThrowsArgumentNullException() { // Arrange var validator = new BaseLayoutValidator(TestUtil.CreateFakeSettings()); // Act => Assert Assert.Throws<ArgumentNullException>( () => validator.CreatesCircularBaseLayoutReference(MasterFakesFactory.CreateFakeItem(), null)); }