Implemented some proper stubbing out method to return the defined object for testing.

Time logs yet to be fully implemented.
This commit is contained in:
chris.watts90@outlook.com 2017-02-06 22:18:37 +00:00
parent 0bb6c8bc08
commit 83cef61519

View File

@ -1,9 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using Interfaces;
using Newtonsoft.Json;
namespace WindowsDataCenter
{
@ -12,9 +16,13 @@ namespace WindowsDataCenter
{
[Route("")]
public IHttpActionResult GetTimeLogs([FromUri]int user, [FromUri]int calendarWeek)
public IHttpActionResult GetTimeLogs([FromUri]int userId, [FromUri]int calendarWeek)
{
return Json(new List<int> { 0, 1, 2});
var logList = new TimeLogList();
logList.CalendarWeek = calendarWeek;
var msg = new HttpResponseMessage(HttpStatusCode.OK);
msg.Content = new StringContent(JsonConvert.SerializeObject(logList),Encoding.UTF8, "application/json");
return ResponseMessage(msg);
}
}
}