コード例 #1
0
        public void IsGetFormattedTaxedPriceReturnsCorrectly()
        {
            var shirt = new Shirt {
                Price = 10F, Tax = 1.2F
            };
            var taxedPrice = shirt.GetFormattedTaxedPrice();

            Assert.AreEqual("$12.00", taxedPrice);
        }
コード例 #2
0
        public void IsGetFormattedTaxedPriceReturnsCorrectly()
        {
            Shirt shirt = new Shirt
            {
                Price = 10F
            };

            string taxedPrice = shirt.GetFormattedTaxedPrice(1.2F);

            Assert.AreEqual("$12.00", taxedPrice);
        }
コード例 #3
0
 public IActionResult AddShirt(Shirt shirt)
 {
     _repository.AddShirt(shirt);
     _logger.LogDebug($"A {shirt.Color.ToString()} shirt of size {shirt.Size.ToString()} with a price of {shirt.GetFormattedTaxedPrice()} was added successfully.");
     return(RedirectToAction("Index"));
 }