Ejemplo n.º 1
0
        public void Invalid_Alteration_Updating_Must_Not_Call_Repository()
        {
            //Arrange
            var repository          = A.Fake <IAlterationRepository>();
            var notificationContext = A.Fake <INotificationContext>();
            var rightShortenValue   = new ShortenValue(Constants.INVALID_SHORTENVALUE);
            var leftShortenValue    = new ShortenValue(Constants.VALID_SHORTENVALUE);
            var alteration          = new Alteration(Constants.VALID_CUSTOMERID, SuitType.Jacket, rightShortenValue, leftShortenValue);
            var alterationService   = new AlterationService(repository, notificationContext);

            //Act
            var ret = alterationService.CreateAlterationAsync(alteration);

            //Assert
            A.CallTo(() => repository.UpdateAsync(alteration)).MustNotHaveHappened();
        }
Ejemplo n.º 2
0
        public void Order_Alteration_Succesfully_Calling_Repository_MustSucceed()
        {
            //Arrange
            var repository          = A.Fake <IAlterationRepository>();
            var notificationContext = A.Fake <INotificationContext>();
            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);
            var alterationService   = new AlterationService(repository, notificationContext);

            //Act
            var ret = alterationService.CreateAlterationAsync(alteration);

            //Assert
            Assert.NotNull(ret);
        }