public void Get_SampleTestEntity() { var newEntity = new SampleTestEntity() { Name = "test entity", HardProperty = new string[] { "testA", "testB" } }; int?returnId = _SampleEntityService.AddSampleTestEntity(newEntity).GetAwaiter().GetResult(); Assert.IsNotNull(returnId, "Entity was not added"); var result = _SampleEntityService.GetSampleTestEntity(1).GetAwaiter().GetResult(); Assert.IsNotNull(result, "Entity was not avaialable and resulted as null"); Assert.IsInstanceOf <SampleTestEntity>(result, "Entity is not of type SampleTestEntity"); }
// GET: SampleTestEntities/Details/1 public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } var SampleTestEntity = await _service.GetSampleTestEntity(id); if (SampleTestEntity == null) { return(NotFound()); } return(View(SampleTestEntity)); }