adapter
This commit is contained in:
parent
605e39e09e
commit
bbc83bd593
|
@ -1,8 +1,8 @@
|
|||
const adapteeMessage = 'Adaptee#method was called';
|
||||
const adapteeMessage = 'Вызов адаптирующегося метода';
|
||||
|
||||
class Adaptee {
|
||||
String method() {
|
||||
print('Adaptee#method is being called');
|
||||
print('Вызов адаптирующегося метода');
|
||||
|
||||
return adapteeMessage;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ abstract class Target {
|
|||
class Adapter implements Target {
|
||||
String call() {
|
||||
var adaptee = Adaptee();
|
||||
print('Adapter#call is being called');
|
||||
print('Вызов адаптирующегося метода');
|
||||
|
||||
return adaptee.method();
|
||||
}
|
||||
|
@ -25,5 +25,5 @@ void main() {
|
|||
var adapter = Adapter();
|
||||
var result = adapter.call();
|
||||
|
||||
assert(result == adapteeMessage);
|
||||
print(result == adapteeMessage);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue