public void RunTest()
        {
            var s = new Square(1.23f);
            {
                var result = s.AsString();
                Assert.False(string.IsNullOrEmpty(result));
            }

            var redSquare = new ColoredShape(s, "red");
            {
                var result = redSquare.AsString();
                Assert.False(string.IsNullOrEmpty(result));
            }

            var transparentSquare = new TransparentShape(s, 0.5f);
            {
                var result = transparentSquare.AsString();
                Assert.False(string.IsNullOrEmpty(result));
            }

            var redTransparentSquare = new TransparentShape(redSquare, 0.5f);
            {
                var result = redTransparentSquare.AsString();
                Assert.False(string.IsNullOrEmpty(result));
            }
        }
        public void RunTransparencyTest()
        {
            var circle = new TransparentShape <ColoredShape <Circle> >(0.4f);
            var s      = circle.AsString();

            Assert.False(string.IsNullOrEmpty(s));
        }
예제 #3
0
        private static void Main(string[] args)
        {
            var tcs = new TransparentShape <ColoredShape <Square> >();
            var cts = new ColoredShape <TransparentShape <Square> >();

            Console.WriteLine(tcs.AsString());
            Console.WriteLine(cts.AsString());

            Console.ReadLine();
        }
예제 #4
0
        public static void Main(string[] args)
        {
            var redSquare = new ColoredShape <Square>("red");

            Console.WriteLine(redSquare.AsString());

            var circle = new TransparentShape <ColoredShape <Circle> >(0.4f);

            Console.WriteLine(circle.AsString());
        }
예제 #5
0
        static void Main(string[] args)
        {
            var circle = new TransparentShape <ColoredShape <Circle> >(0.4f);

            WriteLine(circle.AsString());
        }