-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
56 lines (46 loc) · 1.61 KB
/
Program.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;
using FactoryPattern.Business;
using FactoryPattern.Business.Models.Commerce;
namespace FactoryPattern
{
/// <summary>
/// Main Program class
/// </summary>
class Program
{
/// <summary>
/// The main static method for program
/// </summary>
/// <param name="args">given arguments list</param>
static void Main(string[] args)
{
#region Create Order
Console.Write("Recipient Country: ");
var recipientCountry = Console.ReadLine().Trim();
Console.Write("Sender Country: ");
var senderCountry = Console.ReadLine().Trim();
Console.Write("Total Order Weight: ");
var totalWeight = Convert.ToInt32(Console.ReadLine().Trim());
var order = new Order
{
Recipient = new Address
{
To = "Filip Ekberg",
Country = recipientCountry
},
Sender = new Address
{
To = "Someone else",
Country = senderCountry
},
TotalWeight = totalWeight
};
order.LineItems.Add(new Item("CSHARP_SMORGASBORD", "C# Smorgasbord", 100m), 1);
order.LineItems.Add(new Item("CONSULTING", "Building a website", 100m), 1);
#endregion
var cart = new ShoppingCart(order);
var shippingLabel = cart.Finalize();
Console.WriteLine(shippingLabel);
}
}
}