Пример #1
0
        public void AddGroupTest()
        {
            var model = new BsFactions(_actors.Object);

            model.Add(_actor1.Object, BsFaction.Blue | BsFaction.Green);
            Assert.IsFalse(model.AreAllies(_actor1.Object, _actor2.Object));
            Assert.IsTrue(model.Contains(_actor1.Object, BsFaction.Blue));
            Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Red));
            Assert.IsTrue(model.Contains(_actor1.Object, BsFaction.Green));
        }
Пример #2
0
        public void RemoveGroupTest()
        {
            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 | BsFaction.Green);
            Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Blue));
            Assert.IsTrue(model.Contains(_actor1.Object, BsFaction.Red));
            Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Green));
        }
Пример #3
0
        public void JoinFactionTest()
        {
            var model = new BsFactions(_actors.Object);
            var res   = new BsActionResult();

            model.Join(_actor1.Object, BsFaction.Blue, res);
            Assert.IsTrue(model.Contains(_actor1.Object, BsFaction.Blue));
            Assert.IsTrue(res.Ok);

            res = new BsActionResult();
            model.Join(_actor1.Object, BsFaction.Blue, res);
            Assert.IsTrue(model.Contains(_actor1.Object, BsFaction.Blue));
            Assert.IsFalse(res.Ok);
        }
Пример #4
0
        public void InitTest()
        {
            var model = new BsFactions(_actors.Object);

            Assert.IsFalse(model.AreAllies(_actor1.Object, _actor2.Object));
            Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Blue));
            Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Red));
            Assert.IsFalse(model.Contains(_actor1.Object, BsFaction.Green));
            Assert.IsFalse(model.Contains(_actor2.Object, BsFaction.Blue));
            Assert.IsFalse(model.Contains(_actor2.Object, BsFaction.Red));
            Assert.IsFalse(model.Contains(_actor2.Object, BsFaction.Green));
        }