public async Task ExchangeItemAsync_WithNewItemIsNull_ShouldThrowArgumentNullException() { // Arrange var local = new LocalFixture(); var service = local.CreateService(); var newItem = local.CreateNewItem(); // Act Func <Task> function = async() => await service.ExchangeItemAsync(null, newItem, default); // Assert using (new AssertionScope()) { await function.Should().ThrowAsync <ArgumentNullException>(); } }
public async Task ExchangeItemAsync_WithOldItemOnNoShoppingLists_ShouldDoNothing() { // Arrange var local = new LocalFixture(); var service = local.CreateService(); ItemId oldItemId = local.CreateOldItemId(); IStoreItem newItem = local.CreateNewItem(); local.ShoppingListRepositoryMock.SetupFindActiveByAsync(oldItemId, Enumerable.Empty <IShoppingList>()); // Act await service.ExchangeItemAsync(oldItemId, newItem, default); // Assert using (new AssertionScope()) { local.ShoppingListRepositoryMock.VerifyStoreAsyncNever(); } }