public void GetAll_WhenGetAllElements_ThenReturnedCountIsTheSameLikeInDb() { // Arrange var amountBeforeCreating = db.AeroplaneTypes.Count(); // Act var returnedCount = service.GetAll().Count; // Assert Assert.AreEqual(returnedCount, amountBeforeCreating); }
public IActionResult Get() { IEnumerable <AeroplaneTypeDto> aeroplaneTypeDtos; try { aeroplaneTypeDtos = aeroplaneTypeService.GetAll(); } catch (Exception ex) { return(BadRequest(new { ErrorType = ex.GetType().Name, ex.Message })); } return(Ok(aeroplaneTypeDtos)); }