public void Name_LengthIsGreaterThan50_NotValid() { var team = new Team() { Name = new string('C', 51) }; var result = TestModelHelper.Validate(team); Assert.AreEqual(1, result.Count); }
public void Name_LengthIsLessThan3_NotValid() { var team = new Team() { Name = "aa", }; var result = TestModelHelper.Validate(team); Assert.AreEqual(1, result.Count); //lub Assert.AreEqual("message", result[0].ErrorMessage); }
public void AllTeamData_IsValid() { var team = new Team() { Name = _name, DateOfFounding = _dateOfFounding }; var result = TestModelHelper.Validate(team); Assert.AreEqual(0, result.Count); }
public void NameNicknameSurname_LengthIsGreaterThan50_NotValid() { var player = new Player() { Name = new string('A', 51), Surname = new string('B', 51), Nickname = new string('C', 51) }; var result = TestModelHelper.Validate(player); Assert.AreEqual(3, result.Count); }
public void NameNicknameSurname_LengthIsLessThan3_NotValid() { var player = new Player() { Name = "AA", Surname = "BB", Nickname = "CC", }; var result = TestModelHelper.Validate(player); Assert.AreEqual(3, result.Count); }
public void NameSurname_IncorrectStringRegex_NotValid() { var player = new Player() { Name = "Glup0t7j@k", Surname = "Bzduryafa3q2ads1", Nickname = "Whatever;)" }; var result = TestModelHelper.Validate(player); Assert.AreEqual(2, result.Count); }
public void Nickname_CannotBeEqualToName_NotValid() { var player = new Player() { Name = _name, Surname = _surname, Nickname = _name }; var result = TestModelHelper.Validate(player); Assert.AreEqual(1, result.Count); }
public void Nickname_CannotContaint666Substring_NotValid() { var player = new Player() { Name = _name + "666", Surname = _surname, Nickname = _nickname }; var result = TestModelHelper.Validate(player); Assert.AreEqual(1, result.Count); }
public void Salary_CannotBeLessThan0_NotValid() { var player = new Player() { Name = _name, Surname = _surname, Nickname = _nickname, Salary = -10 }; var result = TestModelHelper.Validate(player); Assert.AreEqual(1, result.Count); }