public CommonInteractionTests() { _fakeDrug1 = Drug.GetFakeDrug(); _fakeDrug2 = Drug.GetFakeDrug(); _fakeDrug3 = Drug.GetFakeDrug(); _fakeDrugList = new List <Drug> { _fakeDrug1, _fakeDrug2, _fakeDrug3 }; }
public IEnumerable <Drug> GetAllTheDrugs() { // Simulate DB Access Times Thread.Sleep(2000); return(new List <Drug> { Drug.GetFakeDrug(), Drug.GetFakeDrug(), Drug.GetFakeDrug() }); }
public IEnumerable <Drug> GetSpecificDrugs(IEnumerable <int> drugIds) { if (drugIds.Any(di => di > 100)) { throw new ArgumentException(nameof(drugIds)); } var drugs = new List <Drug> { Drug.GetFakeDrug(), Drug.GetFakeDrug(), Drug.GetFakeDrug() }; SpecificDrugRetrievedEvent?.Invoke(this, new SpecificDrugRetrievedArgs { DrugIds = drugIds }); return(drugs.Where(d => drugIds.Any(drugId => drugId == d.Id))); }