Пример #1
0
        public void CloneTest()
        {
            var health = AspectFactory.Health();
            var clone  = health.Clone();

            Assert.IsNotNull(clone);
        }
Пример #2
0
        public void DeserializeReturnsSelfTest()
        {
            var health = AspectFactory.Health();

            health.Restore = new Action(() => {});
            var self = health.Deserialize(JsonConvert.DeserializeObject("{}"));

            Assert.IsNotNull(self);
        }
Пример #3
0
        public void GainHealth_IncreasesHealthByAmount()
        {
            var aspect = AspectFactory.Health();

            aspect.Wounds = 100;

            aspect.GainHealth(60);

            Assert.AreEqual(40, aspect.Wounds);
        }
Пример #4
0
        public void SerializeTest()
        {
            var complex = AspectFactory.Complex();

            complex.stats  = AspectFactory.Stats();
            complex.health = AspectFactory.Health();

            var data = complex.Serialize();

            Assert.IsNotNull(data["stats"]);
            Assert.IsNotNull(data["health"]);
        }
Пример #5
0
        public void MaxHealthLaunchesQueryEvent()
        {
            var eventList = new List <Event>();

            var mockSelf = new Mock <Character>();

            mockSelf.Setup(self => self.ReceiveEvent(It.IsAny <Event>()))
            .Callback <Event>(eventList.Add);

            var health = AspectFactory.Health();

            health.Host = mockSelf.Object;

            var max = health.Max;

            mockSelf.VerifyAll();
            Assert.AreEqual("query_max_health", eventList[0].Name);
        }
Пример #6
0
 public void HealthTest()
 {
     Assert.IsNotNull(AspectFactory.Health());
 }