public ITestActionResult Post([FromBody] DateAndTimeOfDayModel dt) { Assert.NotNull(dt); Assert.Equal(99, dt.Id); Assert.Equal(new DateTime(2099, 1, 1), dt.Birthday); Assert.Equal(new TimeSpan(0, 14, 13, 15, 179), dt.CreatedTime); Assert.Equal(new DateTime(1990, 12, 22), dt.EndDay); return(Created(dt)); }
public ITestActionResult Get(int key) { DateAndTimeOfDayModel dtm = db.DateTimes.FirstOrDefault(e => e.Id == key); if (dtm == null) { return(NotFound()); } return(Ok(dtm)); }