public void ItSetPropertyDateBooked(DateTime dateBooked, Proxy.Models.Timesheet.Update model)
 {
     model.DateBooked = dateBooked;
     Assert.Equal(dateBooked, model.DateBooked);
 }
 public void ItSetPropertyComment(string comment, Proxy.Models.Timesheet.Update model)
 {
     model.Comment = comment;
     Assert.Equal(comment, model.Comment);
 }
 public void ItSetPropertyToTime(TimeSpan toTime, Proxy.Models.Timesheet.Update model)
 {
     model.ToTime = toTime;
     Assert.Equal(toTime, model.ToTime);
 }
 public void ItSetPropertyTotalHours(decimal totalHours, Proxy.Models.Timesheet.Update model)
 {
     model.TotalHours = totalHours;
     Assert.Equal(totalHours, model.TotalHours);
 }
 public void ItSetPropertyFromTime(TimeSpan fromTime, Proxy.Models.Timesheet.Update model)
 {
     model.FromTime = fromTime;
     Assert.Equal(fromTime, model.FromTime);
 }
 public void ItSetPropertySelectedActivity(string selectedActivity, Proxy.Models.Timesheet.Update model)
 {
     model.SelectedActivity = selectedActivity;
     Assert.Equal(selectedActivity, model.SelectedActivity);
 }
 public void ItSetPropertySelectedProject(string selectedProject, Proxy.Models.Timesheet.Update model)
 {
     model.SelectedProject = selectedProject;
     Assert.Equal(selectedProject, model.SelectedProject);
 }
 public void ItSetPropertyTimesheetID(int timesheetID, Proxy.Models.Timesheet.Update model)
 {
     model.TimesheetID = timesheetID;
     Assert.Equal(timesheetID, model.TimesheetID);
 }
        public async Task ItUpdateTimesheetSuccessfully()
        {
            var service = await GetInMemoryProjectService().ConfigureAwait(false);

            const int    timesheetID      = 2;
            const string selectedProject  = "Vodacom 2";
            const string selectedActivity = "Vodacom Projects 2";
            TimeSpan     fromTime         = new TimeSpan(08, 30, 00);
            TimeSpan     toTime           = new TimeSpan(16, 00, 00);
            const int    totalHours       = 8;
            DateTime     dateBooked       = new DateTime(2020, 06, 4, 00, 00, 00, 000);
            const string comment          = "I was busy with vodacom project 2";

            Timesheets timesheet = new Timesheets()
            {
                TimesheetID      = timesheetID,
                SelectedProject  = selectedProject,
                SelectedActivity = selectedActivity,
                FromTime         = fromTime,
                ToTime           = toTime,
                TotalHours       = totalHours,
                DateBooked       = dateBooked,
                Comment          = comment
            };

            var timesheetCreated = service.AddTimesheet(new Proxy.Models.Timesheet.Create
            {
                SelectedProject  = selectedProject,
                SelectedActivity = selectedActivity,
                FromTime         = fromTime,
                ToTime           = toTime,
                TotalHours       = totalHours,
                DateBooked       = dateBooked,
                Comment          = comment
            });

            var result = service.GetAllTimesheets().First();

            Proxy.Models.Timesheet.Update model = new Proxy.Models.Timesheet.Update
            {
                TimesheetID      = 2,
                SelectedProject  = "Vodacom 2",
                SelectedActivity = "Vodacom Projects 2",
                FromTime         = new TimeSpan(08, 30, 00),
                ToTime           = new TimeSpan(16, 00, 00),
                TotalHours       = 8,
                DateBooked       = new DateTime(2020, 06, 4, 00, 00, 00, 000),
                Comment          = "I was busy with vodacom project 2"
            };

            var timesheetUpdated = service.Update(model);

            Assert.Equal(timesheetUpdated.TimesheetID, model.TimesheetID);
            Assert.Equal(timesheetUpdated.SelectedProject, model.SelectedProject);
            Assert.Equal(timesheetUpdated.SelectedActivity, model.SelectedActivity);
            Assert.Equal(timesheetUpdated.FromTime, model.FromTime);
            Assert.Equal(timesheetUpdated.ToTime, model.ToTime);
            Assert.Equal(timesheetUpdated.TotalHours, model.TotalHours);
            Assert.Equal(timesheetUpdated.DateBooked, model.DateBooked);
            Assert.Equal(timesheetUpdated.Comment, model.Comment);
        }