public void OneToManyMapper_RemoveParent(int parentId, int childId) { var parent = new Parent(parentId); var child = new Child(childId); var oneToManyMapper = new OneToManyMapper(); oneToManyMapper.parentList.Add(parent); oneToManyMapper.childList.Add(child); oneToManyMapper.Add(parentId, childId); oneToManyMapper.RemoveParent(parentId); Assert.True(oneToManyMapper.parentList.Count == 0, $"Parent was not removed from parentList"); Assert.True(oneToManyMapper.childList.Count == 0, $"Orphan child was not removed from childList"); }
public void ShouldThrowArgumentException_WhenInputIsOutOfMinRange() { Assert.Throws <ArgumentException>(() => _sut.RemoveParent(0)); }