Esempio n. 1
0
 private void NotifyAndException(Alteration alteration)
 {
     if (!alteration.IsValid())
     {
         _notificationContext.AddNotifications(alteration.GetNotifications());
         throw new DomainException("Error on values provided.");
     }
 }
Esempio n. 2
0
        public void Create_Without_Input_Any_ShortenValue_Must_Be_False()
        {
            //Arrange
            var rightShortenValue = new ShortenValue(0);
            var leftShortenValue  = new ShortenValue(0);
            var alteration        = new Alteration(Constants.VALID_CUSTOMERID, SuitType.Jacket, rightShortenValue, leftShortenValue);

            //Act
            var valid = alteration.IsValid();

            //Assert
            Assert.False(valid);
        }
Esempio n. 3
0
        public void Create_With_Valid_Inputs_ShortenValue_Must_Be_True()
        {
            //Arrange
            var rightShortenValue = new ShortenValue(Constants.VALID_SHORTENVALUE);
            var leftShortenValue  = new ShortenValue(Constants.VALID_SHORTENVALUE);
            var alteration        = new Alteration(Constants.VALID_CUSTOMERID, SuitType.Jacket, rightShortenValue, leftShortenValue);

            //Act
            var valid = alteration.IsValid();

            //Assert
            Assert.True(valid);
        }