Пример #1
0
        public void EquipmentAccessor_GetEquipment_Null()
        {
            accessor = GetAccessor();

            var res = accessor.GetEquipment(99).Result;

            Assert.IsNull(res);
        }
Пример #2
0
        public void EquipmentAccessor_GetEquipment()
        {
            accessor = GetAccessor();

            var res = accessor.GetEquipment(2).Result;

            Assert.IsNotNull(res);
            Assert.AreEqual(typeof(Equipment), res.GetType());
            Assert.AreEqual("Name 2", res.Name);
        }
        public async Task <bool> DeleteEquipment(long equipmentId)
        {
            var equipment = await EquipmentAccessor.GetEquipment(equipmentId);

            equipment.Deleted = true;

            try
            {
                await EquipmentAccessor.SaveEquipment(equipment);

                return(true);
            }
            catch (Exception ex)
            {
                Logger.Log("Could not delete equipment", TraceEventType.Error, ex);
                return(false);
            }
        }
 public async Task <Equipment> GetEquipment(long equipmentId)
 {
     return(await EquipmentAccessor.GetEquipment(equipmentId));
 }