public void GetById_ClubExist_ReturnClub() { var club = ModelSetup.SetupClubWithNoPeople(); var result = GetResult <Club>("/api/club/" + club.Id); result.Id.ShouldBe(club.Id); }
public void GetById_ClubExist_ReturnOk() { var club = ModelSetup.SetupClubWithNoPeople(); var response = GetResponse("/api/club/" + club.Id); response.StatusCode.ShouldBe(HttpStatusCode.OK); }
public void GetPeople_ClubExistNoPeople_ReturnsList() { var club = ModelSetup.SetupClubWithNoPeople(); var result = GetResult <Person>("/api/club/" + club.Id + "/people"); result.ShouldBeNull(); }
public void Update_ValidUpdate_Return200() { var club = ModelSetup.SetupClubWithNoPeople(); var response = PutResponse("/api/club", club); response.StatusCode.ShouldBe(HttpStatusCode.OK); }
public void Update_IdNotFound_Return204() { var club = ModelSetup.SetupClubWithNoPeople(); club.Id = 1; var response = PutResponse("/api/club", club); response.StatusCode.ShouldBe(HttpStatusCode.NoContent); }
public void Update_InvalidModel_Return400() { var club = ModelSetup.SetupClubWithNoPeople(); club.NafaClubNumber = -1; var response = PutResponse("/api/club", club); response.StatusCode.ShouldBe(HttpStatusCode.BadRequest); }
public void Update_ValidUpdate_ReturnUpdateModel() { string newName = "Updated"; var club = ModelSetup.SetupClubWithNoPeople(); club.Name = newName; var result = PutResult <Club>("/api/club", club); result.Name.ShouldBe(newName); }
public static void PopulateTestData(FlyballDbContext context) { Sheridan.Flyball.Data.EFCore.SeedData.PopulateData(context); context.Clubs.Add(ModelSetup.SetupClubWithPeople()); context.Clubs.Add(ModelSetup.SetupClubWithNoPeople()); var tournament = ModelSetup.KingsTournament; tournament.AddDivision(ModelSetup.Open1); tournament.AddDivision(ModelSetup.Open2); tournament.AddDivision(ModelSetup.Regular1); tournament.AddDivision(ModelSetup.Regular2); tournament.AddRaceYear(ModelSetup.CurrentRaceYear); tournament.AddRace(ModelSetup.Race1LeftSide); tournament.AddRace(ModelSetup.Race1RightSide); context.SaveChanges(); }