Ejemplo n.º 1
0
 public void GetMonthlyPayments_IsCorrect()
 {
     // Arrange
     processor = new CommadProcessor(this, "", irequest.Object);
     processor.ShowMenu();
     // Act
     processor.ProcessCommand("4");
     // Assert
     Assert.IsTrue(lines.Contains("суммарная месячная плата:100500"));
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }