public ActionResult <MeteorologyViewModel> Get(Guid id) { var res = _bo.Read(id); if (res.Success) { if (res.Result == null) { return(NotFound()); } var mvm = MeteorologyViewModel.Parse(res.Result); return(mvm); } else { return(new ObjectResult(HttpStatusCode.InternalServerError)); } }
public void TestCreateMeteorology() { BoraNowSeeder.Seed(); var mbo = new MeteorologyBusinessObject(); var meteo = new Meteorology(10, 11, 50, 2, 7, DateTime.Now.AddDays(200)); var resCreate = mbo.Create(meteo); var restGet = mbo.Read(meteo.Id); Assert.IsTrue(resCreate.Success && restGet.Success && restGet.Result != null); }