Skip to content

Commit

Permalink
整理
Browse files Browse the repository at this point in the history
  • Loading branch information
rexlucien committed Oct 26, 2015
1 parent 0d50ca2 commit 2978b26
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 22 deletions.
10 changes: 0 additions & 10 deletions Rex.Skill.Tdd.Tests/PotterShoppingCart/PotterShoppingCartTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@ namespace Rex.Skill.Tdd.Tests.PotterShoppingCart
// In order to 提供最便宜的價格給來買書的爸爸媽媽
// As a 佛心的出版社老闆
// I want to 設計一個哈利波特的購物車
public static class 哈利波特
{
public static string1=> @"哈利波特第1集";
public static string2=> @"哈利波特第2集";
public static string3=> @"哈利波特第3集";
public static string4=> @"哈利波特第4集";
public static string5=> @"哈利波特第5集";
}

[TestClass]
public class PotterShoppingCartTests
{
Expand All @@ -41,7 +32,6 @@ public class PotterShoppingCartTests
// And 第五集買了 0 本
// When 結帳
// Then 價格應為 100 元

[TestMethod]
public void集買了一本_其他都沒買_價格應為100x1等於100()
{
Expand Down
11 changes: 11 additions & 0 deletions Rex.Skill.Tdd.Tests/PotterShoppingCart/哈利波特.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Rex.Skill.Tdd.Tests.PotterShoppingCart
{
public static class 哈利波特
{
public static string1=> @"哈利波特第1集";
public static string2=> @"哈利波特第2集";
public static string3=> @"哈利波特第3集";
public static string4=> @"哈利波特第4集";
public static string5=> @"哈利波特第5集";
}
}
1 change: 1 addition & 0 deletions Rex.Skill.Tdd.Tests/Rex.Skill.Tdd.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<Compile Include="Calculator\CalculatorTests.cs" />
<Compile Include="GroupPaging\GroupPagingServiceTests.cs" />
<Compile Include="PotterShoppingCart\PotterShoppingCartTests.cs" />
<Compile Include="PotterShoppingCart\哈利波特.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
Expand Down
9 changes: 9 additions & 0 deletions Rex.Skill.Tdd/PotterShoppingCart/Book.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Rex.Skill.Tdd.PotterShoppingCart
{
public class Book
{
public int Id { get; set; }
public string Name { get; set; }
public decimal Price { get; set; }
}
}
9 changes: 9 additions & 0 deletions Rex.Skill.Tdd/PotterShoppingCart/IShoppingCart.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System.Collections.Generic;

namespace Rex.Skill.Tdd.PotterShoppingCart
{
public interface IShoppingCart
{
decimal Caculate(List<Book> books);
}
}
12 changes: 0 additions & 12 deletions Rex.Skill.Tdd/PotterShoppingCart/PotterShoppingCart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@

namespace Rex.Skill.Tdd.PotterShoppingCart
{
public interface IShoppingCart
{
decimal Caculate(List<Book> books);
}

public class PotterShoppingCart : IShoppingCart
{
public decimal Caculate(List<Book> books)
Expand Down Expand Up @@ -36,11 +31,4 @@ public decimal Caculate(List<Book> books)
return total;
}
}

public class Book
{
public int Id { get; set; }
public string Name { get; set; }
public decimal Price { get; set; }
}
}
2 changes: 2 additions & 0 deletions Rex.Skill.Tdd/Rex.Skill.Tdd.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
<Compile Include="GroupPaging\GroupPagingContext.cs" />
<Compile Include="GroupPaging\GroupPagingService.cs" />
<Compile Include="GroupPaging\IGroupPagingContext.cs" />
<Compile Include="PotterShoppingCart\Book.cs" />
<Compile Include="PotterShoppingCart\IShoppingCart.cs" />
<Compile Include="PotterShoppingCart\PotterShoppingCart.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
Expand Down

0 comments on commit 2978b26

Please sign in to comment.