Esempio n. 1
0
        public void OnRemoveItemAtPosition_WhenNoItemExists_ThrowsException()
        {
            var position      = Vector2Int.one;
            var boardRegistry = new BoardRegistry <TestBoardItem>();

            Assert.Throws <Exception>(() => boardRegistry.Remove(position));
        }
Esempio n. 2
0
        public void OnRemoveItem_WhenNoItemExists_ThrowsException()
        {
            var item          = new TestBoardItem(Vector2Int.zero);
            var boardRegistry = new BoardRegistry <TestBoardItem>();

            Assert.Throws <Exception>(() => boardRegistry.Remove(item));
        }
Esempio n. 3
0
        public void OnRemoveItem_RemovesItem()
        {
            var position      = Vector2Int.one;
            var item          = new TestBoardItem(position);
            var boardRegistry = new BoardRegistry <TestBoardItem>();

            boardRegistry.Add(item);

            Assert.That(boardRegistry.Get(position) == item);

            boardRegistry.Remove(item);

            Assert.That(boardRegistry.Get(position) == null);
        }