Esempio n. 1
0
        public void ItemQualitiesRetrieveListTest()
        {
            // Arrange
            var expectedQualList = new List <ItemQualities>();
            var expectedQual     = new ItemQualities(1)
            {
                Description = "Special",
                Passive     = true,
                QualityName = "Speical Weapon"
            };

            expectedQualList.Add(expectedQual);
            expectedQual = new ItemQualities(2)
            {
                Description = "Super Special",
                Passive     = false,
                QualityName = "Super Speical Weapon"
            };
            expectedQualList.Add(expectedQual);

            // Act
            var actualQualRepository = new ItemQualitiesRepository();
            var actualQualList       = actualQualRepository.Retrieve();

            // Assert
            for (int i = 0; i < actualQualList.Count; i++)
            {
                Assert.AreEqual(expectedQualList[i].Description, actualQualList[i].Description);
                Assert.AreEqual(expectedQualList[i].Passive, actualQualList[i].Passive);
                Assert.AreEqual(expectedQualList[i].QualityName, actualQualList[i].QualityName);
            }
        }
Esempio n. 2
0
        public void WeaponRetrieveTest()
        {
            // Arrange
            var combatSkillRepository   = new CombatSkillRepository();
            var itemQualitiesRepository = new ItemQualitiesRepository();
            var expectedWeapon          = new Weapon(1)
            {
                Name           = "Baster Pistol",
                BaseDamage     = 3,
                CriticalRating = 4,
                Description    = "Fires blaster bolts",
                Encumbrance    = 2,
                HardPoints     = 2,
                Price          = 400,
                Range          = 2,
                Rarity         = 3,
                Skill          = combatSkillRepository.Retrieve(1),
                Special        = itemQualitiesRepository.Retrieve()
            };
            // Act
            var actualWeaponRepository = new WeaponRepository();
            var actualWeapon           = actualWeaponRepository.Retrieve(1);

            // Assert
            Assert.AreEqual(expectedWeapon.Name, actualWeapon.Name);
            Assert.AreEqual(expectedWeapon.BaseDamage, actualWeapon.BaseDamage);
            Assert.AreEqual(expectedWeapon.CriticalRating, actualWeapon.CriticalRating);
            Assert.AreEqual(expectedWeapon.Description, actualWeapon.Description);
            Assert.AreEqual(expectedWeapon.Encumbrance, actualWeapon.Encumbrance);
            Assert.AreEqual(expectedWeapon.HardPoints, actualWeapon.HardPoints);
            Assert.AreEqual(expectedWeapon.Price, actualWeapon.Price);
            Assert.AreEqual(expectedWeapon.Range, actualWeapon.Range);
            Assert.AreEqual(expectedWeapon.Rarity, actualWeapon.Rarity);
            Assert.AreEqual(expectedWeapon.Skill.Description, actualWeapon.Skill.Description);
            Assert.AreEqual(expectedWeapon.Skill.SkillName, actualWeapon.Skill.SkillName);
            Assert.AreEqual(expectedWeapon.Skill.SkillAbility.AbilityName, actualWeapon.Skill.SkillAbility.AbilityName);
            Assert.AreEqual(expectedWeapon.Skill.SkillAbility.Description, actualWeapon.Skill.SkillAbility.Description);

            for (int i = 0; i < expectedWeapon.Special.Count; i++)
            {
                Assert.AreEqual(expectedWeapon.Special[i].Description, actualWeapon.Special[i].Description);
                Assert.AreEqual(expectedWeapon.Special[i].Passive, actualWeapon.Special[i].Passive);
                Assert.AreEqual(expectedWeapon.Special[i].QualityName, actualWeapon.Special[i].QualityName);
            }
        }
Esempio n. 3
0
        public void ItemQualitiesRetrieveTest()
        {
            // Arrange
            var quality = new ItemQualities(1)
            {
                Description = "Special",
                Passive     = true,
                QualityName = "Speical Weapon"
            };

            // Act
            var qualityRepo = new ItemQualitiesRepository();
            var qual        = qualityRepo.Retrieve(1);

            // Asert
            Assert.AreEqual(quality.Description, qual.Description);
            Assert.AreEqual(quality.Passive, qual.Passive);
            Assert.AreEqual(quality.QualityName, qual.QualityName);
        }