Esempio n. 1
0
        public void GetIdFromEmptyList()
        {
            var idList   = new List <IId>();
            var idSetter = new IdSetter(idList);

            Assert.AreEqual(idSetter.getId(), 0);
        }
Esempio n. 2
0
        public void GetIdAfterAdding()
        {
            var idList = this.CreateIdList(1);

            var idSetter = new IdSetter(idList);

            Assert.AreEqual(idSetter.getId(), 1);
        }
Esempio n. 3
0
        private void AddToList(ref List <IId> idList)
        {
            var player   = new Player();
            var idSetter = new IdSetter(idList);

            player.Id = idSetter.getId();
            idList.Add(player);
        }
Esempio n. 4
0
        public void Add(Team newPlayer)
        {
            var idControler = new IdSetter(this.Teams.OfType <IId>().ToList <IId>());
            int newId       = idControler.getId();

            newPlayer.Id = newId;
            Console.WriteLine("NEW ID IS : {0}", newId);

            this.Teams.Add(newPlayer);
        }
Esempio n. 5
0
        public void GetIdAfterRemovingLast()
        {
            var idList = this.CreateIdList(20);

            idList.RemoveAt(19);

            var idSetter = new IdSetter(idList);

            Assert.AreEqual(idSetter.getId(), 19);
        }
Esempio n. 6
0
        public void GetIdAfterRemovingInTheMiddleOfList()
        {
            var idList = this.CreateIdList(30);

            idList.RemoveAt(15);

            var TestIdSetter = new IdSetter(idList);

            Assert.AreEqual(TestIdSetter.getId(), 15);
        }
Esempio n. 7
0
        public void GetIdAfterRemovingFirst()
        {
            var idList = this.CreateIdList(30);

            idList.RemoveAt(0);

            var TestIdSetter = new IdSetter(idList);

            Assert.AreEqual(TestIdSetter.getId(), 0);
        }
Esempio n. 8
0
        public void GetIdAfterPlacingSomeElementsInTheMiddle()
        {
            var idList = this.CreateIdList(30);

            idList.RemoveAt(14);
            idList.RemoveAt(14);
            idList.RemoveAt(14);

            this.AddToList(ref idList);
            this.AddToList(ref idList);

            var TestIdSetter = new IdSetter(idList);

            Assert.AreEqual(TestIdSetter.getId(), 16);
        }