public void NegativeValidation() { var target = new GreaterThanZeroTarget(-3); var notification = Validator.ValidateObject(target); Assert.IsFalse(notification.IsValid()); var expected = new NotificationMessage("Amount", "Must be a positive number"); Assert.AreEqual(expected, notification.AllMessages[0]); Assert.AreEqual(1, notification.AllMessages.Length); }
public void NotificationMessage_Has_An_Error_Severity_By_Default() { var message = new NotificationMessage("something", "else"); message.Severity.ShouldEqual(Severity.Error); }
public bool Contains(NotificationMessage message) { return _list.Contains(message); }
public void Add(NotificationMessage message) { _list.Add(message); }