public void Test1() { var candyRepo = new CandyRepository(); var result = candyRepo.GetAll(); Assert.NotEmpty(result); }
public static void Main(string[] args) { CandyRepository repository = new CandyRepository(); List <CandySupply> candies = repository.getAll(); CandyService candyService = new CandyService(); bool flag = true; while (flag) { candyService.printAllCandy(candies); Console.WriteLine("Enter function name(add, all, del, exi):"); switch (Console.ReadLine()) { case "add": { candies = candyService.addCandy(candies); break; } case "all": { candyService.printAllCandy(candies); break; } case "del": { candies = candyService.deleteCandy(candies); break; } case "exi": { flag = false; break; } default: break; } } }
public CandyController(CandyRepository repository) { _repository = repository; }