Beispiel #1
0
    private EmployeeRequest GetNextRequest()
    {
        if (EmployeeRequests.Count() > 0)
        {
            return(EmployeeRequests.OrderBy(act => act.StartDate).First());
        }

        return(null);
    }
Beispiel #2
0
        public ActionResult MyRequests()
        {
            var context      = new VITVSecondContext();
            var userId       = User.Identity.GetUserId();
            var requestsToMe = context.TaskRequests.Where(tr => tr.ReceivedEmployees.Any(e => e.Id == userId)).ToList();

            var model = new EmployeeRequests
            {
                RequestsToMe = requestsToMe
            };

            return(View(model));
        }
Beispiel #3
0
 public void Setup()
 {
     target = new EmployeeRequests();
     MockEmployeeRepository = new Mock <IEmployeeRepository>();
     MockEmployeeRepository.Setup(x =>
                                  x.GetEmployeeByCityState(It.IsAny <string>(), It.IsAny <string>()))
     .Returns(new List <EmployeeDto>
     {
         new EmployeeDto {
             City = "Seattle", State = "Washington", FirstName = "bob"
         }
     });
     target.EmployeeRepository = MockEmployeeRepository.Object;
 }
 public void SetUp()
 {
     ExpectedCity  = "TestCity";
     ExpectedState = "Id";
     Expected      = new List <EmployeeDto> {
         new EmployeeDto(), new EmployeeDto(), new EmployeeDto()
     };
     EmployeeRepositoryMock = new Mock <IEmployeeRepository>();
     EmployeeRepositoryMock.Setup(x => x.GetEmployeeByCityState(ExpectedCity, ExpectedState))
     .Returns(Expected);
     Target = new EmployeeRequests {
         EmployeeRepository = EmployeeRepositoryMock.Object
     };
     Actual = Target.GetEmployeeByLocation(ExpectedCity, ExpectedState);
 }