public void Test() { var areaComparer = new AreaComparer(); var result = areaComparer.Compare(new Square(30), new Cube(30)); Console.WriteLine(result); var result2 = areaComparer.Compare(new Square(20), new Square(20)); Console.WriteLine(result2); var volumeComparer = new VolumeComparer(); var result3 = volumeComparer.Compare(new Sphere(20), new Cube(30)); Console.WriteLine(result3); }
static void Main(string[] args) { var areaComparer = new AreaComparer(); var volumeComparer = new VolumeComparer(); var result1 = areaComparer.Compare(new Circle(7).Radius, new Square(7.0).Area); var result2 = volumeComparer.Compare(new Cube(10.0).Volume, new Sphere(10).Volume); }