Skip to content

Commit 939e41b

Browse files
committed
Code review
1 parent 2681294 commit 939e41b

16 files changed

+45
-9
lines changed

.vs/CleanCodeDemo/v15/.suo

-19.5 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

CleanCodeDemo/Business/ProductManager.cs

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using CleanCodeDemo.BankServices;
23
using CleanCodeDemo.Entities;
34
using CleanCodeDemo.Interfaces;
45

@@ -18,8 +19,34 @@ public void Sell(Product product, IPerson person)
1819
var price = person.CampaignHandler.Calculate(product);
1920
var exchangePrice = _bankService.ConvertRate(new CurrencyRate { Currency = 1, Price = price });
2021

21-
Console.WriteLine("Müşteri Tipi İndirim Karşılığı:" + price.ToString("#.##"));
22-
Console.WriteLine("Döviz Karşılığı:" + exchangePrice.ToString("#.##"));
22+
Console.WriteLine(person.Name +" İsimli Müşterimiz için indirim Karşılığı:" + price.ToString("#.##"));
23+
Console.WriteLine("Ürünün Döviz Karşılığı:" + exchangePrice.ToString("#.##"));
24+
Console.WriteLine("#####################################################");
2325
}
24-
}
26+
public static void CustomerSell()
27+
{
28+
IProductService productService = new ProductManager(new CentralBankServiceAdapter());
29+
productService.Sell(
30+
new Product { ProductId = 1, ProductName = "Laptop", ProductPrice = 1000 },
31+
new Customer() { Id = 1, Name = "Kerem" }
32+
);
33+
}
34+
35+
public static void StudentSell()
36+
{
37+
IProductService productService = new ProductManager(new IsBankServiceAdapter());
38+
productService.Sell(
39+
new Product { ProductId = 1, ProductName = "Laptop", ProductPrice = 1000 },
40+
new Student() { Id = 1, Name = "Nesil" }
41+
);
42+
}
43+
public static void OfficerSell()
44+
{
45+
IProductService productService = new ProductManager(new FakeBankService());
46+
productService.Sell(
47+
new Product { ProductId = 1, ProductName = "Laptop", ProductPrice = 1000 },
48+
new Officer() { Id = 1, Name = "Engin" }
49+
);
50+
}
51+
}
2552
}

CleanCodeDemo/Program.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using System;
22
using CleanCodeDemo.BankServices;
3-
using CleanCodeDemo.Business;
43
using CleanCodeDemo.Entities;
54
using CleanCodeDemo.Interfaces;
5+
using static CleanCodeDemo.Business.ProductManager;
66

77
namespace CleanCodeDemo
88
{
@@ -13,12 +13,13 @@ protected Program()
1313
}
1414
static void Main(string[] args)
1515
{
16-
IProductService productService = new ProductManager(new IsBankServiceAdapter());
17-
productService.Sell(
18-
new Product { ProductId = 1, ProductName = "Laptop", ProductPrice = 1000 },
19-
new Customer() { Id = 1, Name = "Kerem" }
20-
);
16+
CustomerSell();
17+
StudentSell();
18+
OfficerSell();
2119
Console.ReadLine();
2220
}
21+
22+
23+
2324
}
2425
}
512 Bytes
Binary file not shown.
2 KB
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
29daf54d2baa667b1cbafab9c2f1f20bf2ad24ce
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
C:\Users\kerem\source\repos\CleanCodeDemo\CleanCodeDemo\bin\Debug\CleanCodeDemo.exe.config
2+
C:\Users\kerem\source\repos\CleanCodeDemo\CleanCodeDemo\bin\Debug\CleanCodeDemo.exe
3+
C:\Users\kerem\source\repos\CleanCodeDemo\CleanCodeDemo\bin\Debug\CleanCodeDemo.pdb
4+
C:\Users\kerem\source\repos\CleanCodeDemo\CleanCodeDemo\obj\Debug\CleanCodeDemo.csprojAssemblyReference.cache
5+
C:\Users\kerem\source\repos\CleanCodeDemo\CleanCodeDemo\obj\Debug\CleanCodeDemo.csproj.CoreCompileInputs.cache
6+
C:\Users\kerem\source\repos\CleanCodeDemo\CleanCodeDemo\obj\Debug\CleanCodeDemo.exe
7+
C:\Users\kerem\source\repos\CleanCodeDemo\CleanCodeDemo\obj\Debug\CleanCodeDemo.pdb

0 commit comments

Comments
 (0)