public void WhenShopByUniqueIdIsNullTheReturnEmptyShop() { var shopRepository = new Mock <IShopRepository>(); shopRepository.Setup(r => r.GetShopById(It.IsAny <Guid>())).Returns((Shop)null); var shopRepositoryService = new ShopRepositoryService(shopRepository.Object, Mock.Of <IUserRepository>()); ShopDto shop = shopRepositoryService.GetShopByUniqueId(It.IsAny <Guid>()); shop.ShouldBeEquivalentTo(ShopDto.EmptyShop); }
public void WhenShopByNameDoesntExistThenEmptyShopIsReturned() { var shopRepository = new Mock <IShopRepository>(); shopRepository.Setup(r => r.GetShopByName("shopName")).Returns((Shop)null); var shopRepositoryService = new ShopRepositoryService(shopRepository.Object, Mock.Of <IUserRepository>()); ShopDto shop = shopRepositoryService.GetShopByName("shopName"); shop.ShouldBeEquivalentTo(ShopDto.EmptyShop); }