Ejemplo n.º 1
0
        public async Task <PriceV1> CreatePriceAsync(string correlationId, PriceV1 price)
        {
            price.Id       = price.Id ?? IdGenerator.NextLong();
            price.Priority = price.Priority ?? PriceV1.DEFAULT_PRIORITY;

            return(await _persistence.CreateAsync(correlationId, price));
        }
        private async Task TestCreatePricesAsync()
        {
            // Create the first price
            var price = await _persistence.CreateAsync(null, PRICE1);

            Assert.NotNull(price);
            Assert.True(PRICE1.Equals(price));

            // Create the second price
            price = await _persistence.CreateAsync(null, PRICE2);

            Assert.NotNull(price);
            Assert.True(PRICE2.Equals(price));

            // Create the third price
            price = await _persistence.CreateAsync(null, PRICE3);

            Assert.NotNull(price);
            Assert.True(PRICE3.Equals(price));
        }