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);
        }
Beispiel #2
0
        public async Task CreateDollarPrice(CreateDollarRateCommand createDollarRateCommand)
        {
            var url = "/api/dollarRate";

            await PostAsync(url, createDollarRateCommand);
        }
Beispiel #3
0
 public async Task CreateDollarPrice(CreateDollarRateCommand createDollarRateCommand) => _commandDispatcher.Dispatch(createDollarRateCommand);
 public async Task Post(CreateDollarRateCommand command) => _commandDispatcher.Dispatch(command);