public void WhenRequestedShopExistThenReturnThatShop() { var shopRepositoryService = new ShopRepositoryService(Mock.Of <IShopRepository>(r => r.GetShopByName("shopName") == new Shop() { Name = "shopName" }), Mock.Of <IUserRepository>()); ShopDto shop = shopRepositoryService.GetShopByName("shopName"); shop.Should().NotBeNull(); shop.Name.Should().Be("shopName"); }
public void WhenShopWithSpecifiedUniqueIdExistThenReturnThatShop() { Guid shopGuid = Guid.NewGuid(); var shopRepositoryService = new ShopRepositoryService(Mock.Of <IShopRepository>(r => r.GetShopById(shopGuid) == new Shop() { UniqueId = shopGuid }), Mock.Of <IUserRepository>()); ShopDto shop = shopRepositoryService.GetShopByUniqueId(shopGuid); shop.Should().NotBeNull(); shop.ShopGuid.Should().Be(shopGuid); }