-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
37 lines (35 loc) · 1.14 KB
/
Program.cs
File metadata and controls
37 lines (35 loc) · 1.14 KB
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
using System;
namespace TestTdd
{
internal class Program
{
public static void Main(string[] args)
{
// Normal way
{
NormalData data = new NormalData("here");
NormalStore store = new NormalStore();
store.Energy = 5;
NormalService service = new NormalService();
NormalUi ui = new NormalUi(data, store, service);
Console.WriteLine("Let service calculate: 22 + 5");
ui.Add(22, 5);
}
// After TDD way
{
SimpleData data = new SimpleData("somewhere");
SimpleStore store = new SimpleStore();
store.Energy = 5;
SimpleService service = new SimpleService();
SimpleUi ui = new SimpleUi();
ui.Data = data;
ui.Store = store;
ui.Service = service;
ui.Init();
Console.WriteLine("Let service calculate: 10 + 9");
ui.Add(10, 9);
Console.WriteLine(ui.Message);
}
}
}
}