Пример #1
0
        public void WhenShopIsNullThenEditShopReturnsNotSuccessfull()
        {
            var shopConfigurationService = new ShopConfigurationService(Mock.Of <IShopRepository>());

            var result = shopConfigurationService.EditShop(null);

            result.Status.Should().Be(ActionStatus.NotSuccessfull);
        }
Пример #2
0
        public void WhenShopNotFoundThenEditShopReturnsNotSuccessfull()
        {
            var shopRepository = new Mock <IShopRepository>();

            shopRepository.Setup(r => r.GetShopById(It.IsAny <Guid>())).Returns((Shop)null);

            var shopConfigurationService = new ShopConfigurationService(shopRepository.Object);

            var result = shopConfigurationService.EditShop(new ShopDto());

            result.Status.Should().Be(ActionStatus.NotSuccessfull);
        }
Пример #3
0
        public void WhenShopFoundButExceptionOccuredThenEditShopReturnWithExceptionStatus()
        {
            var shopRepository = new Mock <IShopRepository>();

            shopRepository.Setup(r => r.GetShopById(new Guid("{4BA29681-3FA1-431E-8C98-12E3B952BA25}"))).Returns(new Shop());

            var shopConfigurationService = new ShopConfigurationService(shopRepository.Object);

            ServiceActionResult actionResult = shopConfigurationService.EditShop(new ShopDto()
            {
                ShopGuid = new Guid("{4BA29681-3FA1-431E-8C98-12E3B952BA25}"), Address = new UserAddressDto()
            });

            actionResult.Status.Should().Be(ActionStatus.WithException);
        }