public void GetTimesheets(Infrastructure.Timesheet.MockTimesheetService service) { var controller = new Proxy.Controllers.TimesheetsController(service); var result = controller.GetTimesheets(); Assert.IsType <ActionResult <GetTimesheetsWrapperResponse> >(result); Assert.Equal(createSource, (result.Value as GetTimesheetsWrapperResponse)?.source); Assert.Equal(code, (result.Value as GetTimesheetsWrapperResponse)?.code); AssertUnhandledExceptionsGetTimesheet(createSource, result); }
public void UpdateTimesheet(Update model, Infrastructure.Timesheet.MockTimesheetService service) { var controller = new Proxy.Controllers.TimesheetsController(service); var result = controller.UpdateTimesheet(model); Assert.IsType <ActionResult <UpdateWrapperResponse> >(result); Assert.Equal(createSource, (result.Value as UpdateWrapperResponse)?.source); Assert.Equal(updatedCode, (result.Value as UpdateWrapperResponse)?.code); Assert.Equal("Timesheet Updated Succesfully", (result.Value as UpdateWrapperResponse)?.message); AssertUnhandledExceptionsUpdateTimesheet(createSource, result); }