public void user_requests_a_sell() { SCENARIO["User trades stocks"] = DESCRIBE | "User requests a sell before close of trading" | GIVEN | "I have 100 shares of MSFT stock".MapAction(Have100SharesOfMsftStock) | WHEN | "I ask to sell 20 shares of MSFT stock".MapAction(AskToSell20SharesOfMsftStock) | THEN | "I should have 80 shares of MSFT stock".MapAction(ShouldHave80SharesOfMsftStock); SCENARIO.Execute().IsSuccess.Should().BeTrue(); }
public void user_requests_a_sell_dynamic(int share, int sells, int total) { Let["share-value"] = share; Let["sells-value"] = sells; Let["total-value"] = total; SCENARIO["User trades stocks"] = DESCRIBE | "User requests a sell before close of trading" | GIVEN | "I have :share-value shares of MSFT stock" | WHEN | "I ask to sell :sells-value shares of MSFT stock" | THEN | "I should have :total-value shares of MSFT stock"; Mapper.Setup_user_trades_stocks_scenario_dynamic(); SCENARIO.Execute().IsSuccess.Should().BeTrue(); }
public void user_requests_a_sell_before_close_of_trading() { SCENARIO["User trades stocks before close of trading"] = DESCRIBE | "User requests a sell before close of trading" | GIVEN | "I have 100 shares of MSFT stock" | AND | "I have 150 shares of APPL stock" | AND | "The time is before close of trading" | WHEN | "I ask to sell 20 shares of MSFT stock" | THEN | "I should have 150 shares of APPL stock" | AND | "I should have 80 shares of MSFT stock"; Mapper.Setup_user_requests_a_sell_before_close_of_trading(); SCENARIO.Execute().IsSuccess.Should().BeTrue(); }