Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 2
0
 public void ShouldThrowArgumentException_WhenInputIsOutOfMinRange()
 {
     Assert.Throws <ArgumentException>(() => _sut.RemoveChild(0));
 }