Esempio n. 1
0
        public void RemoveTest()
        {
            var model = new BsFactions(_actors.Object);

            model.Add(_actor1.Object, BsFaction.Blue);
            model.Add(_actor1.Object, BsFaction.Red);
            model.Add(_actor1.Object, BsFaction.Green);

            model.Remove(_actor1.Object, BsFaction.Blue);
            Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Blue));
            Assert.IsTrue(model.Contains(_actor1.Object, BsFaction.Red));
            Assert.IsTrue(model.Contains(_actor1.Object, BsFaction.Green));

            model.Remove(_actor1.Object, BsFaction.Blue);
            Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Blue));
            Assert.IsTrue(model.Contains(_actor1.Object, BsFaction.Red));
            Assert.IsTrue(model.Contains(_actor1.Object, BsFaction.Green));

            model.Remove(_actor1.Object, BsFaction.Red);
            Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Blue));
            Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Red));
            Assert.IsTrue(model.Contains(_actor1.Object, BsFaction.Green));

            model.Remove(_actor1.Object, BsFaction.Green);
            Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Blue));
            Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Red));
            Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Green));
        }
Esempio n. 2
0
        public void AreAlliesTest()
        {
            var model = new BsFactions(_actors.Object);

            model.Add(_actor1.Object, BsFaction.Blue);
            model.Add(_actor2.Object, BsFaction.Blue);
            Assert.IsTrue(model.AreAllies(_actor1.Object, _actor2.Object));

            model.Remove(_actor2.Object, BsFaction.Blue);
            Assert.IsFalse(model.AreAllies(_actor1.Object, _actor2.Object));
        }