public void OneToManyMapper_RemoveChild(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.RemoveChild(childId); Assert.True(oneToManyMapper.childList.Count == 0, $"Child was not removed from childList"); Assert.True(parent.children.Count == 0, $"Child was not removed from childList"); }
public void ShouldThrowArgumentException_WhenInputIsOutOfMinRange() { Assert.Throws <ArgumentException>(() => _sut.RemoveChild(0)); }