public void AddBundleShouldAddBundleProductsToOrder() { // Given A.CallTo(() => _addBundleToOrderCommand.Run(Constants.IphoneCaseOrder.Id, Constants.IphoneBundle.Id)) .DoesNothing(); // When _ordersController.AddBundle(Constants.IphoneCaseOrder.Id, new BundleWrapper(Constants.IphoneBundle.Id)); // Then A.CallTo(() => _addBundleToOrderCommand.Run(Constants.IphoneCaseOrder.Id, Constants.IphoneBundle.Id)) .MustHaveHappened(); }
public void RunShouldAddProductsFromBundleToOrder() { var expectedProducts = new[] { Constants.IphoneCase }; // Given A.CallTo(() => _dapperService.List <Product>(A <string> .Ignored, A <object> .Ignored)) .Returns(expectedProducts); A.CallTo(() => _addProductToOrderCommand.Run(Constants.IphoneCaseOrder.Id, Constants.IphoneCase.Id)) .DoesNothing(); // When _addBundleToOrderCommand.Run(Constants.IphoneCaseOrder.Id, Constants.IphoneBundle.Id); // Then A.CallTo(() => _dapperService.List <Product>(A <string> .Ignored, A <object> .Ignored)) .MustHaveHappened(); A.CallTo(() => _addProductToOrderCommand.Run(Constants.IphoneCaseOrder.Id, Constants.IphoneCase.Id)) .MustHaveHappened(); }
public void AddBundle(Guid id, [FromBody] BundleWrapper bundle) { _addBundleToOrderCommand.Run(id, bundle.BundleId); }