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);
        }
示例#2
0
        public async Task CreateOuncePrice(CreateOuncePriceCommand createOncePriceCommand)
        {
            var url = "/api/ouncePrice";

            await PostAsync(url, createOncePriceCommand);
        }
示例#3
0
 public async Task CreateOuncePrice(CreateOuncePriceCommand createOncePriceCommand) => _commandDispatcher.Dispatch(createOncePriceCommand);
示例#4
0
 public void Post(CreateOuncePriceCommand command) => _commandDispatcher.Dispatch(command);