コード例 #1
0
        public void TestHealthStationWeighingAnother()
        {
            Person        mannen  = new Person("Master Blaster", 500, 3000, 300);
            HealthStation station = new HealthStation();

            Assert.AreEqual(3000, station.Weigh(mannen), "Station.Weigh(Person) should return the weight of the person!");
        }
コード例 #2
0
        public void TestHealthStationWeighing()
        {
            Person        mannen  = new Person("Superman", 35, 200, 300);
            HealthStation station = new HealthStation();

            Assert.AreEqual(200, station.Weigh(mannen), "Station.Weigh(Person) should return the weight of the person!");
        }
コード例 #3
0
 /// <summary>
 /// add healthstations as the invoker for the health change event
 /// </summary>
 /// <param name="invoker"></param>
 public static void AddPlayerHealthChangeInvoker(HealthStation invoker)
 {
     playerHealthChangedInvokers.Add(invoker);
     foreach (UnityAction <int> listener in PlayerHealthChanedListeners)
     {
         invoker.AddPlayerHealthChangeListener(listener);
     }
 }
コード例 #4
0
        public void TestHealthStationFeeding()
        {
            Person        mannen  = new Person("Superman", 35, 200, 300);
            HealthStation station = new HealthStation();

            station.Feed(mannen);

            Assert.AreEqual(201, station.Weigh(mannen), "Station.Feed(Person) should increase the weight of the person by one!");
        }
コード例 #5
0
        public void TestHealthStationWeighingCounter()
        {
            Person        mannen  = new Person("Superman", 35, 200, 300);
            HealthStation station = new HealthStation();

            station.Weigh(mannen);
            station.Weigh(mannen);
            station.Weigh(mannen);
            station.Weigh(mannen);

            Assert.AreEqual(4, station.weighings, "Station.Weigh(Person) should increase the weight and the 'int weighings' by one!");
        }
コード例 #6
0
        public void TestHealthStationConstructor()
        {
            string code = "";

            try
            {
                code = File.ReadAllText("HealthStation.cs");
            }
            catch
            {
                Console.WriteLine("Your file is not there yet!");
            }
            HealthStation station = new HealthStation();

            Assert.AreEqual(station.GetType(), typeof(HealthStation), "The HealthStation should be of type HealthStation!");
        }