public void ShouldResetErrors()
 {
     var errors = new ErrorMessageStringCollection();
     errors.Add("Name", "Name can't be blank");
     errors.Clear("Name");
     Assert.IsFalse(errors.HasErrors);
 }
 public void ShouldAccessMessagesWithKey()
 {
     var erros = new ErrorMessageStringCollection();
     erros.Add("Name", "Name can't be blank");
     erros.Add("Name", "Name can't be empty");
     Assert.AreEqual("Name can't be blank\nName can't be empty", erros["Name"]);
 }
 public void ShouldClearMessagesWithKey()
 {
     var errors = new ErrorMessageStringCollection();
     errors.Add("Name", "Name can't be blank");
     errors.Add("Name", "Name can't be empty");
     errors.Clear("Name");
     Assert.IsNull(errors["Name"]);
 }
 public void ShouldStringContainMessages()
 {
     var erros = new ErrorMessageStringCollection();
     erros.Add("Name", "Name can't be blank");
     Assert.AreEqual("Name can't be blank", (string)erros);
 }
 public void ShouldNotHaveErrors()
 {
     var errors = new ErrorMessageStringCollection();
     Assert.IsFalse(errors.HasErrors);
 }
 public void ShouldHaveErrors()
 {
     var errors = new ErrorMessageStringCollection();
     errors.Add("Name", "Name can't be blank");
     Assert.IsTrue(errors.HasErrors);
 }
 public void ShouldAddMessageWithKey()
 {
     var erros = new ErrorMessageStringCollection();
     erros.Add("Name", "Name can't be blank");
     Assert.Pass();
 }