public void GetTransactionsForUser_ReturnsCorrectTransactions_True() { IBarcodeSystem barcodeSystem = Substitute.For <IBarcodeSystem>(); User user = Substitute.For <User>(userArgs); Product product = Substitute.For <Product>(productArgs); user.Balance = 1000m; const int amountOfPurchases = 5; for (int i = 0; i < amountOfPurchases; i++) { barcodeSystem.BuyProduct(user, product); } IEnumerable <Transaction> transactionsForUser = barcodeSystem.GetTransactionsForUser(user, amountOfPurchases); Assert.That(transactionsForUser, Is.All.Property("User").EqualTo(user)); }
public ProductSetActiveState(string[] command, bool isActive, IBarcodeCLI barcodeCli, IBarcodeSystem barcodeSystem) : base(command, barcodeCli, barcodeSystem) { active = isActive; }
public ProductSetCreditState(string[] command, bool canBeBoughtOnCredit, IBarcodeCLI barcodeCli, IBarcodeSystem barcodeSystem) : base(command, barcodeCli, barcodeSystem) { credit = canBeBoughtOnCredit; }
public AddCreditToUser(string[] command, IBarcodeCLI barcodeCli, IBarcodeSystem barcodeSystem) : base(command) { this.barcodeCli = barcodeCli; this.barcodeSystem = barcodeSystem; }
public DisplayAllProductsCommand(string[] command, IBarcodeCLI barcodeCli, IBarcodeSystem barcodeSystem) : base(command) { this.barcodeCli = barcodeCli; this.barcodeSystem = barcodeSystem; }
protected ProductSetCommand(string[] command, IBarcodeCLI barcodeCli, IBarcodeSystem barcodeSystem) : base(command) { this.barcodeCli = barcodeCli; this.barcodeSystem = barcodeSystem; }
public DisplayUserInfoCommand(string[] command, IBarcodeCLI barcodeCli, IBarcodeSystem barcodeSystem) : base(command) { this.barcodeCli = barcodeCli; this.barcodeSystem = barcodeSystem; }
public BuyProductCommand(string[] command, IBarcodeCLI barcodeCli, IBarcodeSystem barcodeSystem) : base(command) { this.barcodeCli = barcodeCli; this.barcodeSystem = barcodeSystem; }