Ejemplo n.º 1
0
        public ActionResult Index(string date)
        {
            TimeEntryFormViewModel formView = _timeEntryManagementService.CreateFormViewModel(GetWeekEndingDate(date),
                                                                                              _authenticationProvider.
                                                                                              GetLoggedInUser());

            return(View(formView));
        }
Ejemplo n.º 2
0
        public void CanCreateFormViewModel()
        {
            // Establish Context
            var viewModelToExpect = new TimeEntryFormViewModel();

            _personManagementService.Expect(x => x.GetByUserName(Arg <string> .Is.Anything)).Return(
                PersonInstanceFactory.CreateValidTransientPerson());
            //_timeEntryRepository.Expect(x => x.GetRecentRequests(Arg<int>.Is.Anything)).Return(null);

            // Act
            TimeEntryFormViewModel viewModelRetrieved =
                _timeEntryManagementService.CreateFormViewModel(DateTime.Today, "testuser");

            // Assert
            viewModelRetrieved.ShouldNotBeNull();
            viewModelRetrieved.TimeEntry.ShouldBeNull();
        }