-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5cd4b58
commit 6ea92cd
Showing
10 changed files
with
489 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 15 | ||
VisualStudioVersion = 15.0.26124.0 | ||
MinimumVisualStudioVersion = 15.0.26124.0 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logic", "Logic\Logic.csproj", "{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "Test\Test.csproj", "{C207CC72-59C4-4D09-82AC-9E6EBB844892}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Debug|x64 = Debug|x64 | ||
Debug|x86 = Debug|x86 | ||
Release|Any CPU = Release|Any CPU | ||
Release|x64 = Release|x64 | ||
Release|x86 = Release|x86 | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Debug|x64.Build.0 = Debug|Any CPU | ||
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Debug|x86.ActiveCfg = Debug|Any CPU | ||
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Debug|x86.Build.0 = Debug|Any CPU | ||
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Release|x64.ActiveCfg = Release|Any CPU | ||
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Release|x64.Build.0 = Release|Any CPU | ||
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Release|x86.ActiveCfg = Release|Any CPU | ||
{EC4507FE-091D-411F-A0A2-B28A9F5EEBE9}.Release|x86.Build.0 = Release|Any CPU | ||
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Debug|x64.ActiveCfg = Debug|Any CPU | ||
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Debug|x64.Build.0 = Debug|Any CPU | ||
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Debug|x86.ActiveCfg = Debug|Any CPU | ||
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Debug|x86.Build.0 = Debug|Any CPU | ||
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Release|x64.ActiveCfg = Release|Any CPU | ||
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Release|x64.Build.0 = Release|Any CPU | ||
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Release|x86.ActiveCfg = Release|Any CPU | ||
{C207CC72-59C4-4D09-82AC-9E6EBB844892}.Release|x86.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace Logic | ||
{ | ||
public class CouponEvaluator { | ||
|
||
public void ApplyCoupon(Order order) { | ||
|
||
// Save 10% with the SAVE10 coupon code | ||
if (order.CouponCode == "SAVE10") { | ||
order.CouponSavings = order.TotalCost * 0.1m; | ||
} | ||
|
||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net5.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace Logic | ||
{ | ||
|
||
public class Order { | ||
|
||
public int OrderId { get; set; } | ||
|
||
public string CustomerName { get; set; } | ||
|
||
public List<OrderItem> Items { get; set; } | ||
|
||
public string CouponCode { get; set; } | ||
|
||
public decimal CouponSavings { get; set; } = 0m; | ||
|
||
public decimal TotalCost { get; set; } | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Logic | ||
{ | ||
public class OrderItem { | ||
|
||
public int OrderId { get; set; } | ||
|
||
public int OrderItemId { get; set; } | ||
|
||
public Product Product { get; set; } | ||
|
||
public int Quantity { get; set; } | ||
|
||
public decimal TotalPrice { get; set; } | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
|
||
namespace Logic | ||
{ | ||
public class Product | ||
{ | ||
public int ProductId { get; set; } | ||
|
||
public string Name { get; set; } | ||
|
||
public decimal Price { get; set; } | ||
|
||
} | ||
} |
Oops, something went wrong.