public void LevelChanged_WhenLevelSupport_Test()
        {
            var target   = new ReturnsTrueCondition();
            var oldLevel = target.Level;

            target.Level = 2;
            Assert.AreNotEqual(oldLevel, target.Level);
            Assert.AreEqual(2, target.Level);
        }
        public void ConditionAddedEvent_RaisedWhenCustomApplyReturnsTrue_Test()
        {
            var receivedEvents = new List <string>();
            var entity         = Mock.Of <IEntity>();
            var target         = new ReturnsTrueCondition();

            target.ConditionAddedEvent += delegate(object sender, ConditionEventArgs args)
            {
                receivedEvents.Add(args.Condition.ToString());
            };
            target.Apply(entity);
            Assert.IsTrue(receivedEvents.Contains("returns true"));
        }
        public void ConditionLevelAdjustedEvent_RaisedWhenLevelSupported_Test()
        {
            var receivedEvents = new List <string>();
            var entity         = Mock.Of <IEntity>();
            var target         = new ReturnsTrueCondition();

            target.ConditionLevelAdjustedEvent += delegate(object sender, ConditionEventArgs args)
            {
                receivedEvents.Add(args.Condition.ToString());
            };
            target.Level = 7;
            Assert.IsTrue(receivedEvents.Contains("returns true"));
        }
        public void Constructor_Test()
        {
            var first = new ReturnsTrueCondition();

            Assert.AreEqual("returns true", first.Name);
            Assert.AreEqual("description true", first.Description);
            Assert.AreEqual(1, first.Id);
            Assert.AreEqual(1, first.AppliesTo[0]);

            var second = new ReturnsFalseCondition();

            Assert.AreEqual("returns false", second.Name);
            Assert.AreEqual("description false", second.Description);
            Assert.AreEqual(-1, second.Id);
            Assert.AreEqual(-1, second.AppliesTo[0]);
        }