Exemplo n.º 1
0
        public void GangerWeaponsTest()
        {
            var gangId = "321";

            var ganger = new Ganger()
            {
                GangerId = "123",
                GangId   = gangId
            };

            var gangWeapon = new GangWeapon()
            {
                GangId = gangId,
                Weapon = new Weapon()
                {
                    WeaponId = (WeaponEnum)1
                },
                Cost = 10
            };

            _gangerProvider.Setup(gp => gp.GetByGangerId(ganger.GangerId))
            .Returns(ganger);

            var addedGangWeapon = _weaponManager.AddGangWeapon(gangWeapon);

            Assert.AreEqual(0, _weaponManager.GetGangerWeapons(ganger.GangerId).Count());

            var returnedWeapon = _weaponManager.AddGangerWeapon(ganger.GangerId, addedGangWeapon.GangWeaponId);

            Assert.AreEqual("AAAA-BBBB-CCCC", returnedWeapon.GangerWeaponId);
            Assert.AreEqual(1, _weaponManager.GetGangerWeapons(ganger.GangerId).Count());

            _weaponManager.RemoveGangerWeapon(ganger.GangerId, "AAAA-BBBB-CCCC");
            Assert.AreEqual(0, _weaponManager.GetGangerWeapons(ganger.GangerId).Count());
            Assert.AreEqual(1, _weaponManager.GetGangStash(gangId).Count());
        }
Exemplo n.º 2
0
 public IEnumerable <GangerWeapon> GetWeapons([FromUri] string gangerId)
 {
     return(_weaponManager.GetGangerWeapons(gangerId));
 }