示例#1
0
        public void RestoreStat_StatNearKeyPoint_RaiseEventWithCorrentValues2()
        {
            // ARRANGE
            var survivalData = new SurvivalData();

            var stat = survivalData.Stats.SingleOrDefault(x => x.Type == SurvivalStatType.Satiety);

            stat.Value = -25;
            var stat2 = survivalData.Stats.SingleOrDefault(x => x.Type == SurvivalStatType.Water);

            stat2.Value = -25;

            // ACT
            using (var monitor = survivalData.Monitor())
            {
                survivalData.RestoreStat(SurvivalStatType.Water, 3);



                // ASSERT
                monitor.Should().Raise(nameof(ISurvivalData.StatCrossKeyValue))
                .WithArgs <SurvivalStatChangedEventArgs>(args =>
                                                         args.KeyPoint.Level == SurvivalStatHazardLevel.Strong &&
                                                         args.KeyPoint.Value == -25);
            }
        }
示例#2
0
        public void Update_StatNearKeyPoint_RaiseEventWithCorrentValues()
        {
            // ARRANGE
            var survivalData = new SurvivalData();

            var stat = survivalData.Stats.SingleOrDefault(x => x.Type == SurvivalStatType.Satiety);

            stat.Value = 1;



            // ACT
            using (var monitor = survivalData.Monitor())
            {
                survivalData.Update();



                // ASSERT
                monitor.Should().Raise(nameof(ISurvivalData.StatCrossKeyValue))
                .WithArgs <SurvivalStatChangedEventArgs>(args =>
                                                         args.KeyPoint.Level == SurvivalStatHazardLevel.Lesser &&
                                                         args.KeyPoint.Value == 0);
            }
        }