コード例 #1
0
        public static void Test_Individual_Combat_Builder_BuiltContainer_Returns_Null_If_Not_Set(int ata, int atp, int dtp, int evp, int hp, int luck, int mst)
        {
            //arrange
            var builder = GetNewBuilder();

            //act: We don't init tp here in this test
            ImmutableStatsContainer <CombatStatType> container =
                builder.WithAttackAccuracy(ata)
                .WithAttackPower(atp)
                .WithDefensivePower(dtp)
                .WithEvasivePower(evp)
                .WithHitPoints(hp)
                .WithLuck(luck)
                .WithMentalStrength(mst)
                .Build();

            //assert
            Assert.AreEqual(container[CombatStatType.AttackAccuracy].Value, ata);
            Assert.AreEqual(container[CombatStatType.AttackPower].Value, atp);
            Assert.AreEqual(container[CombatStatType.DefensivePower].Value, dtp);
            Assert.AreEqual(container[CombatStatType.EvasivePower].Value, evp);
            Assert.AreEqual(container[CombatStatType.HitPoints].Value, hp);
            Assert.AreEqual(container[CombatStatType.Luck].Value, luck);
            Assert.AreEqual(container[CombatStatType.MentalStrength].Value, mst);

            Assert.IsNull(container[CombatStatType.TechniquePoints]);
        }
コード例 #2
0
        public static void Test_Individual_Combat_Builder_Extensions_Set_Value(int ata, int atp, int dtp, int evp, int hp, int luck, int mst, int tp)
        {
            //arrange
            var builder = GetNewBuilder();

            //act
            ImmutableStatsContainer <CombatStatType> container =
                builder.WithAttackAccuracy(ata)
                .WithAttackPower(atp)
                .WithDefensivePower(dtp)
                .WithEvasivePower(evp)
                .WithHitPoints(hp)
                .WithLuck(luck)
                .WithMentalStrength(mst)
                .WithTechniquePoints(tp)
                .Build();

            //assert
            Assert.AreEqual(container[CombatStatType.AttackAccuracy].Value, ata);
            Assert.AreEqual(container[CombatStatType.AttackPower].Value, atp);
            Assert.AreEqual(container[CombatStatType.DefensivePower].Value, dtp);
            Assert.AreEqual(container[CombatStatType.EvasivePower].Value, evp);
            Assert.AreEqual(container[CombatStatType.HitPoints].Value, hp);
            Assert.AreEqual(container[CombatStatType.Luck].Value, luck);
            Assert.AreEqual(container[CombatStatType.MentalStrength].Value, mst);
            Assert.AreEqual(container[CombatStatType.TechniquePoints].Value, tp);
        }
        public static void Test_Individual_Transient_Builder_BuiltContainer_Returns_Null_If_Not_Set(int hp, int tp)
        {
            //arrange
            var builder = GetNewBuilder();

            //act: In this test we don't init pb
            ImmutableStatsContainer <TransientStatType> container =
                builder.WithHitPoints(hp)
                .WithTechniquePoints(tp)
                .Build();

            //assert
            Assert.AreEqual(container[TransientStatType.HitPoints].Value, hp);
            Assert.AreEqual(container[TransientStatType.TechniquePoints].Value, tp);

            Assert.Null(container[TransientStatType.PhotonBlastCharge]);
        }
        public static void Test_Individual_Transient_Builder_Extensions_Set_Value(int hp, int tp, int pb)
        {
            //arrange
            var builder = GetNewBuilder();

            //act
            ImmutableStatsContainer <TransientStatType> container =
                builder.WithHitPoints(hp)
                .WithTechniquePoints(tp)
                .WithPhotonBlastCharge(pb)
                .Build();

            //assert
            Assert.AreEqual(container[TransientStatType.HitPoints].Value, hp);
            Assert.AreEqual(container[TransientStatType.PhotonBlastCharge].Value, pb);
            Assert.AreEqual(container[TransientStatType.TechniquePoints].Value, tp);
        }
コード例 #5
0
        public static void Test_Individual_Resist_Builder_BuiltContainer_Returns_Null_If_Not_Set(int fire, int ice, int dark, int light, int thunder)
        {
            //arrange
            var builder = GetNewBuilder();

            //act: In this test we removed light.
            ImmutableStatsContainer <ResistanceStatType> container =
                builder.WithDarkResist(dark)
                .WithFireResist(fire)
                .WithIceResist(ice)
                .WithThunderResist(thunder)
                .Build();

            //assert
            Assert.AreEqual(container[ResistanceStatType.ElementalFire].Value, fire);
            Assert.AreEqual(container[ResistanceStatType.ElementalDark].Value, dark);
            Assert.AreEqual(container[ResistanceStatType.ElementalIce].Value, ice);
            Assert.AreEqual(container[ResistanceStatType.ElementalThunder].Value, thunder);

            Assert.IsNull(container[ResistanceStatType.ElementalLight]);
        }
コード例 #6
0
        public static void Test_Individual_Resist_Builder_Extensions_Set_Value(int fire, int ice, int dark, int light, int thunder)
        {
            //arrange
            var builder = GetNewBuilder();

            //act
            ImmutableStatsContainer <ResistanceStatType> container =
                builder.WithDarkResist(dark)
                .WithFireResist(fire)
                .WithIceResist(ice)
                .WithThunderResist(thunder)
                .WithLightResist(light)
                .Build();

            //assert
            Assert.AreEqual(container[ResistanceStatType.ElementalFire].Value, fire);
            Assert.AreEqual(container[ResistanceStatType.ElementalDark].Value, dark);
            Assert.AreEqual(container[ResistanceStatType.ElementalIce].Value, ice);
            Assert.AreEqual(container[ResistanceStatType.ElementalLight].Value, light);
            Assert.AreEqual(container[ResistanceStatType.ElementalThunder].Value, thunder);
        }