Esempio n. 1
0
        public void Create_WhenWishIsEmpty_ThenThrowValidExeption()
        {
            // Arrange
            var wish = new WishDto();

            var service = new WishListService(_unitOfWorkFake, _mapper, _validator);

            // Act - Assert
            Assert.Throws <ValidationException>(() => service.Create(wish));
        }
Esempio n. 2
0
        public void Create_WhenCreateWish_ThenInvokeCreateByRepository()
        {
            // Arrange
            var service = new WishListService(_unitOfWorkFake, _mapper, _alwaysValidValidator);

            // Act
            service.Create(new WishDto());

            // Assert
            A.CallTo(() => _unitOfWorkFake.WishListRepository.Create(A <Wish> ._)).MustHaveHappened();
        }