public void AddStewardess_When_correct_data_Then_count_equal_1() { //assign StewardessDTO stewardess = new StewardessDTO() { Name = "Anna", Surname = "Gorshkova", Birthday = new DateTime(1998, 8, 21) }; //acts stewardessService.AddStewardess(stewardess); //assert Assert.That(Stewardess.Count == 1); }
public JsonResult Post([FromBody] StewardessDTO stewardess) { try { return(Json(stewardessService.AddStewardess(stewardess))); } catch (System.Exception ex) { HttpContext.Response.StatusCode = 400; return(Json(ex.Message)); } }