예제 #1
0
        public void CanGetAllMechanics()
        {
            //Arrange
            MechanicService mechanicService = new MechanicService(MechanicTestResource.TESTMECHANICS);

            //Act
            var result = mechanicService.GetMechanics();

            //Assert
            Assert.Equal(10, result.ToList().Count);
            Assert.Equal(10, mechanicService.Mechanics.ToList().Count);
        }
예제 #2
0
        public void Example_FindAllMechanics()
        {
            //Arrange
            List <Mechanic> mechanics = _service.GetMechanics();

            //Act
            var result = (from mechanic in mechanics
                          select mechanic).ToList().Count();

            //Assert
            Assert.Equal(10, result);
        }
예제 #3
0
        public void Example_FindAllMechanics()
        {
            //Arrange
            List <Mechanic> mechanics = _service.GetMechanics();

            //Act
            List <Mechanic> result = mechanics.Select(mechanic => mechanic).ToList();

            result.ForEach(mechanic => _testOutputHelper.WriteLine(mechanic.Name)); //print names in additional output

            //Assert
            Assert.Equal(10, result.Count);
        }