public void GetPicksList() { //display the picks on the console screen GetPickListResponse response = new GetPickListResponse(); response = service.GetPicks(); Console.Clear(); Console.WriteLine("Ticket Lists"); ConsoleIO.LineSeparator(); ConsoleIO.DisplayHeader(); if (response.Success) { foreach (var p in response.picks) { ConsoleIO.DisplayPickInfo(p); } } else { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(response.Message); Console.ResetColor(); } Console.WriteLine(); Console.WriteLine("Press any key to continue..."); Console.ReadKey(); }
public void CanNotGetPickLists() { IPickRepository repo = new PickInFileRepository(); Service service = new Service(repo, new PickManual()); GetPickListResponse actual = service.GetPicks(); Assert.IsFalse(actual.Success); Assert.IsTrue(actual.picks.Count() == 0); }
public GetPickListResponse GetPicks() { GetPickListResponse response = new GetPickListResponse(); List <Pick> picks = repo.GetPicksList(); if (!picks.Any()) { response.Success = false; response.Message = "There are no tickets bought."; response.picks = picks; return(response); } response.Success = true; response.picks = picks; return(response); }