public async void CurrentPriceOfGold() { //Dollar const decimal dollarRate = 28000; const decimal ouncePrice = 1850; const decimal expectedCurrentGoldPrice = 986.4712514092446448703494927m; var createDollarRateCommand = new CreateDollarRateCommand(rate: dollarRate); var createOncePriceCommand = new CreateOuncePriceCommand(dollar: ouncePrice); IGoldInvestmentApplicationDriver applicationDriver = new GoldInvestmentApplicationApiDriver(); await applicationDriver.Bootstrap(); await applicationDriver.CreateDollarPrice(createDollarRateCommand); await applicationDriver.CreateOuncePrice(createOncePriceCommand); decimal currentPriceOfGold = await applicationDriver.GetCurrentGoldPrice(); Assert.Equal(expectedCurrentGoldPrice, currentPriceOfGold); }
public async Task CreateOuncePrice(CreateOuncePriceCommand createOncePriceCommand) { var url = "/api/ouncePrice"; await PostAsync(url, createOncePriceCommand); }
public async Task CreateOuncePrice(CreateOuncePriceCommand createOncePriceCommand) => _commandDispatcher.Dispatch(createOncePriceCommand);
public void Post(CreateOuncePriceCommand command) => _commandDispatcher.Dispatch(command);