private static string GetProductPriceResultedFormated(IProductPriceResult result)
        {
            string formatedResult = string.Empty;

            if (result is KnownProductPriceResult knownProductPriceResult)
            {
                formatedResult = knownProductPriceResult.Value.ToString();
            }
            else
            {
                formatedResult = "Unknown product";
            }

            return(formatedResult);
        }
        public void Render(IProductPriceResult result)
        {
            var formatedResult = GetProductPriceResultedFormated(result);

            Console.Write(formatedResult);
        }
Exemple #3
0
 public ProductCatalogTestDouble(IProductPriceResult productPriceResult)
 {
     _productPriceResult = productPriceResult;
 }
Exemple #4
0
 public void Render(IProductPriceResult result)
 {
     ResultToRender = result;
 }