-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathTestBridge.cs
27 lines (24 loc) · 952 Bytes
/
TestBridge.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
namespace StructuralPatterns.Bridge;
public static class TestBridge
{
public static void Run()
{
// Abstraction-Implementation combination 1 => Smart TV + Physical Remote
var smartTv = new SmartTv();
var physicalRemote = new PhysicalRemote(smartTv);
physicalRemote.PowerOn();
physicalRemote.VolumeUp();
physicalRemote.PowerOff();
// Abstraction-Implementation combination 2 => Smart TV + Smart App Remote
var smartAppRemote = new SmartAppRemote(smartTv);
smartAppRemote.PowerOn();
smartAppRemote.VolumeUp();
smartAppRemote.PowerOff();
// Abstraction-Implementation combination 3 => Normal TV + Physical Remote
var normalTv = new NormalTv();
var physicalRemote2 = new PhysicalRemote(normalTv);
physicalRemote2.PowerOn();
physicalRemote2.VolumeUp();
physicalRemote2.PowerOff();
}
}