Пример #1
0
        public void NotificationResult_Constructor()
        {
            // Arrange
            var notificationResult = new NotificationResult();

            // Act
            notificationResult.SetSuccessMessage(SuccessMessage);

            // Assert
            Assert.AreEqual(SuccessMessage, notificationResult.SuccessMessage);
            Assert.IsTrue(notificationResult.IsValid);
            Assert.IsTrue(notificationResult.Errors.Count == 0);
        }
Пример #2
0
        public void NotificationResult_SetSuccessMessageWithError()
        {
            // Arrange
            var notificationResult = new NotificationResult();

            // Act
            notificationResult.SetError(ErrorMessage);
            notificationResult.SetSuccessMessage(SuccessMessage);

            // Assert
            Assert.IsTrue(notificationResult.Errors.Any(x => x == ErrorMessage));
            Assert.IsTrue(!notificationResult.IsValid);
            Assert.IsTrue(notificationResult.Errors.Count > 0);
            Assert.IsTrue(notificationResult.SuccessMessage == "");
            Assert.IsTrue(notificationResult.SuccessMessage != SuccessMessage);
        }