public void TestMapElementAddContentKO() { Map map = new Map(3, 3); MapElement element = map[1, 1]; element.AddContent(null); Assert.IsNotNull(element.ContentList); Assert.AreEqual(0, element.ContentList.Count); }
public void TestMapElementAddContentOK() { Map map = new Map(3, 3); MapElement element = map[1, 1]; IMapContent content = new Hero("foo"); element.AddContent(content); Assert.IsNotNull(element.ContentList); Assert.AreEqual(1, element.ContentList.Count); Assert.AreEqual(element, content.Location); MapElement otherElement = map[1, 2]; otherElement.AddContent(content); Assert.AreEqual(0, element.ContentList.Count); Assert.AreEqual(otherElement, content.Location); }