public ChangeItemQuantityOnShoppingListCommand(ShoppingListId shoppingListId, OfflineTolerantItemId itemId, float quantity) { ShoppingListId = shoppingListId ?? throw new ArgumentNullException(nameof(shoppingListId)); OfflineTolerantItemId = itemId ?? throw new ArgumentNullException(nameof(itemId)); Quantity = quantity; }
public ShoppingListReadModel(ShoppingListId id, DateTime?completionDate, ShoppingListStoreReadModel store, IEnumerable <ShoppingListSectionReadModel> sections) { Id = id; CompletionDate = completionDate; Store = store; this.sections = sections; }
public AddItemToShoppingListCommand(ShoppingListId shoppingListId, OfflineTolerantItemId itemId, SectionId sectionId, float quantity) { ShoppingListId = shoppingListId ?? throw new ArgumentNullException(nameof(shoppingListId)); ItemId = itemId ?? throw new ArgumentNullException(nameof(itemId)); SectionId = sectionId; Quantity = quantity; }
public void SetupFindByAsync(ShoppingListId shoppingListId, IShoppingList returnValue) { mock .Setup(instance => instance.FindByAsync( It.Is <ShoppingListId>(id => id == shoppingListId), It.IsAny <CancellationToken>())) .Returns(Task.FromResult(returnValue)); }
public async Task <IShoppingList> FindByAsync(ShoppingListId id, CancellationToken cancellationToken) { if (id == null) { throw new ArgumentNullException(nameof(id)); } var entity = await GetShoppingListQuery() .FirstOrDefaultAsync(list => list.Id == id.Value); cancellationToken.ThrowIfCancellationRequested(); if (entity == null) { return(null); } return(toModelConverter.ToDomain(entity)); }
public ShoppingListAlreadyFinishedReason(ShoppingListId id) { Message = $"Shopping list {id.Value} is already finished."; }
public RemoveItemFromBasketCommand(ShoppingListId shoppingListId, OfflineTolerantItemId itemId) { ShoppingListId = shoppingListId ?? throw new ArgumentNullException(nameof(shoppingListId)); OfflineTolerantItemId = itemId ?? throw new ArgumentNullException(nameof(itemId)); }
public SectionAlreadyInShoppingListReason(ShoppingListId shoppingListId, SectionId sectionId) { Message = $"Section {sectionId} is already part of shopping list {shoppingListId}."; }
public ShoppingListNotFoundReason(ShoppingListId id) { Message = $"Shopping list {id.Value} not found."; }
public RemoveItemFromShoppingListCommand(ShoppingListId shoppingListId, OfflineTolerantItemId itemId) { ShoppingListId = shoppingListId; OfflineTolerantItemId = itemId; }
public ItemNotOnShoppingListReason(ShoppingListId shoppingListId, ItemId shoppingListItemId) { Message = $"Item {shoppingListItemId} is not on shopping list {shoppingListId.Value}."; }
public void SetupId(ShoppingListId returnValue) { Setup(i => i.Id) .Returns(returnValue); }
private async Task <Entities.ShoppingList> FindEntityByIdAsync(ShoppingListId id) { return(await GetShoppingListQuery() .FirstOrDefaultAsync(list => list.Id == id.Value)); }
public ItemAlreadyOnShoppingListReason(ItemId itemId, ShoppingListId listId) { Message = $"Item {itemId} already exists on shopping list {listId.Value}"; }
public IShoppingList Create(ShoppingListId id, StoreId storeId, DateTime?completionDate, IEnumerable <IShoppingListSection> sections) { return(new ShoppingList(id, storeId, completionDate, sections)); }
public FinishShoppingListCommand(ShoppingListId shoppingListId, DateTime completionDate) { ShoppingListId = shoppingListId ?? throw new ArgumentNullException(nameof(shoppingListId)); CompletionDate = completionDate; }