public void GetMonthlyPayments_IsCorrect() { // Arrange processor = new CommadProcessor(this, "", irequest.Object); processor.ShowMenu(); // Act processor.ProcessCommand("4"); // Assert Assert.IsTrue(lines.Contains("суммарная месячная плата:100500")); }
public void ShowMenu_CantainsAlmostAllNeededItems() { // Arrange processor = new CommadProcessor(this, "", irequest.Object); // Act processor.ShowMenu(); // Assert Assert.IsTrue(lines.Count > 0); Assert.IsTrue(lines.Contains("Варианты действий:")); Assert.IsTrue(lines.Contains("q. завершить работу")); Assert.IsTrue(lines.Contains("Главное меню>")); }
public void ReadSortedEmployees_DisplaysFirstTenEmployees() { // Arrange processor = new CommadProcessor(this, "", irequest.Object); processor.ShowMenu(); var names = GenEmploeees().Take(10).Select(s => s.Name); // Act userInput = "q"; processor.ProcessCommand("3"); Thread.Sleep(100); // Assert Assert.IsTrue(lines.Where(w => names.Any(a => w.Contains(a))).Count() == 10); }
public void ReadSortedEmployees_TurnsPageForward() { // Arrange processor = new CommadProcessor(this, "", irequest.Object); processor.ShowMenu(); var names = GenEmploeees().Skip(10).Take(10).Select(s => s.Name).ToList(); // Act userInput = ">"; Task.Run(() => processor.ProcessCommand("3")); Thread.Sleep(100); userInput = ">"; // Assert Assert.IsTrue(lines.Where(w => names.Any(a => w.Contains(a))).Count() == 10); }