java-tutorials/patterns/design-patterns/src/test/java/com/baeldung/BridgePatternIntegrationTest.java
Loredana Crusoveanu 537c1d1150 move design patterns to new module (#4206)
* move design patterns to new module

* fix logger import
2018-05-11 09:11:13 +02:00

27 lines
698 B
Java

package com.baeldung;
import static org.junit.Assert.*;
import org.junit.Test;
import com.baeldung.bridge.Blue;
import com.baeldung.bridge.Red;
import com.baeldung.bridge.Shape;
import com.baeldung.bridge.Square;
import com.baeldung.bridge.Triangle;
public class BridgePatternIntegrationTest {
@Test
public void whenBridgePatternInvoked_thenConfigSuccess() {
//a square with red color
Shape square = new Square(new Red());
assertEquals(square.draw(), "Square drawn. Color is Red");
//a triangle with blue color
Shape triangle = new Triangle(new Blue());
assertEquals(triangle.draw(), "Triangle drawn. Color is Blue");
}
}