public void ShouldThrowWhenGymFull() { var gym = new Gym("weights bg", 1); var athlete = new Athlete("apu"); var athleteTwo = new Athlete("apu's bro"); gym.AddAthlete(athlete); Assert .Throws <InvalidOperationException>(() => gym.AddAthlete(athleteTwo)); }
public void AddAthlete_ThrowsException() { Gym gym = new Gym("Gym", 0); Athlete athlete = new Athlete("Nacepena Batka"); Assert.Throws <InvalidOperationException>(() => gym.AddAthlete(athlete)); }
public void InjureAthlete_ThrowsException() { Gym gym = new Gym("Gym", 5); Athlete athlete = new Athlete("Nacepena Batka"); gym.AddAthlete(athlete); Assert.Throws <InvalidOperationException>(() => gym.InjureAthlete("Fantomas")); }
public void AddAthlete_SuccessfullyIsAdded() { Gym gym = new Gym("Gym", 5); Athlete athlete = new Athlete("Nacepena Batka"); gym.AddAthlete(athlete); Assert.AreEqual(1, gym.Count); }
public void ShouldAddAthleteWhenValid() { var gym = new Gym("weights bg", 5); var athlete = new Athlete("apu"); gym.AddAthlete(athlete); Assert.AreEqual(1, gym.Count); }
public void ShouldRemoveWhenAthleteFound() { var gym = new Gym("weights bg", 1); var athlete = new Athlete("khabib"); gym.AddAthlete(athlete); gym.RemoveAthlete("khabib"); Assert.Zero(gym.Count); }
public void ShouldThrowWhenAthleteToInjureNotFound() { var gym = new Gym("weights bg", 1); var athlete = new Athlete("apu"); gym.AddAthlete(athlete); Assert .Throws <InvalidOperationException>(() => gym.InjureAthlete("404")); }
public void Report_SuccessfullyReported() { Gym gym = new Gym("Gym", 5); Athlete athlete = new Athlete("Nacepena Batka"); string report = $"Active athletes at Gym: Nacepena Batka"; gym.AddAthlete(athlete); var result = gym.Report(); Assert.AreEqual(report, result); }
public void ShouldInjureAthleteWhenDataValid() { var gym = new Gym("weights bg", 1); var athlete = new Athlete("khabib"); gym.AddAthlete(athlete); var injured = gym.InjureAthlete("khabib"); Assert.True(athlete.IsInjured); Assert.AreSame(athlete, injured); }
public void ShouldReport() { var gym = new Gym("weights bg", 1); var athlete = new Athlete("khabib"); gym.AddAthlete(athlete); var report = gym.Report(); Assert.NotNull(report); Assert.True(report.Contains("Active athletes at weights bg: khabib")); }
public void InjureAthlete_SuccessfullyIsInjured() { Gym gym = new Gym("Gym", 5); Athlete athlete = new Athlete("Nacepena Batka"); gym.AddAthlete(athlete); var result = gym.InjureAthlete("Nacepena Batka"); Assert.AreEqual(1, gym.Count); Assert.AreEqual(true, result.IsInjured); Assert.AreEqual("Nacepena Batka", result.FullName); }