コード例 #1
0
        public void ValidateDecorator_Concepts()
        {
            var whisky     = new Whisky();
            var icedWhisky = new IcedWhisky(whisky);

            Assert.Equal("Whisky", whisky.GetDescription());
            Assert.Equal("Whisky, 2 Ice cubes", icedWhisky.GetDescription());
            Assert.Equal(new Currency(5m).Value, whisky.Cost().Value);
            Assert.Equal(new Currency(5.25m).Value, icedWhisky.Cost().Value);
        }