-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDecoratorTest.cs
40 lines (39 loc) · 1.45 KB
/
DecoratorTest.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
28
29
30
31
32
33
34
35
36
37
38
39
40
using DesignPatterns.Structural.Decorator;
using Xunit;
namespace DesignPattern.StructuralPattern.Test
{
public class DecoratorTest
{
[Fact]
public void BaseProperties()
{
IPizzaDecorator basicPizzaBase = new BasicPizzaBase();
Assert.Equal(25, basicPizzaBase.PizzaBase());
Assert.Equal(49.25, basicPizzaBase.Cost());
}
[Fact]
public void SmallPizzaProperties()
{
IPizzaDecorator basicPizzaBase = new BasicPizzaBase();
IPizzaDecorator smallPizzaDecorator = new SmallPizzaDecorator(basicPizzaBase);
Assert.Equal(10, smallPizzaDecorator.PizzaBase());
Assert.Equal(43.80, smallPizzaDecorator.Cost());
}
[Fact]
public void MediumPizzaProperties()
{
IPizzaDecorator basicPizzaBase = new BasicPizzaBase();
IPizzaDecorator mediumPizzaDecorator = new MediumPizzaBase(basicPizzaBase);
Assert.Equal(25, mediumPizzaDecorator.PizzaBase());
Assert.Equal(49.25, mediumPizzaDecorator.Cost());
}
[Fact]
public void LargePizzaProperties()
{
IPizzaDecorator basicPizzaBase = new BasicPizzaBase();
IPizzaDecorator largePizzaDecorator = new LargePizzaBase(basicPizzaBase);
Assert.Equal(45, largePizzaDecorator.PizzaBase());
Assert.Equal(74.75, largePizzaDecorator.Cost());
}
}
}