-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.cs
More file actions
28 lines (23 loc) · 718 Bytes
/
Test.cs
File metadata and controls
28 lines (23 loc) · 718 Bytes
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
28
using Xunit;
namespace adapter.pattern
{
public class Test
{
[Fact]
public void AdapterTest()
{
// Arrange
Sparrow Sparrow = new Sparrow();
IToyDuck toyDuck = new PlasticToyDuck();
// Wrap a bird in a birdAdapter so
// it behaves like a toy duck
IToyDuck birdAdapter = new BirdAdapter(Sparrow);
// Act
// Assert
Assert.Equal("Flying", Sparrow.Fly());
Assert.Equal("Chirp Chirp", Sparrow.MakeSound());
Assert.Equal("Squeak", toyDuck.Squeak());
Assert.Equal("Chirp Chirp", birdAdapter.Squeak());
}
}
}