This file contains hidden or 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
| [Test] | |
| public void WhenUserPlacesACorrectOrderThenAnOrderNumberShouldBeReturned() | |
| { | |
| //Arrange | |
| var shoppingCart = new ShoppingCart(); | |
| shoppingCart.Items.Add(new ShoppingCartItem { ItemId = Guid.NewGuid(), Quantity = 1 }); | |
| var customerId = Guid.NewGuid(); | |
| var expectedOrderId = Guid.NewGuid(); | |
| var orderDataService = Mock.Create<iorderdataservice>(); |
This file contains hidden or 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
| public object PlaceOrder(Guid customerId, ShoppingCart shoppingCart) | |
| { | |
| var order = new Order(); | |
| return _orderDataService.Save(order); | |
| } |
This file contains hidden or 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
| using System; | |
| using System.Linq; | |
| using NUnit.Framework; | |
| using TddStore.Core; | |
| using Telerik.JustMock; | |
| namespace TddStore.UnitTests | |
| { | |
| [TestFixture] | |
| class OrderServiceTests | |
| { |
This file contains hidden or 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
| using System; | |
| namespace TddStore.Core | |
| { | |
| public class OrderService | |
| { | |
| private IOrderDataService _orderDataService; | |
| public OrderService(IOrderDataService orderDataService) | |
| { |
This file contains hidden or 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
| public class OrderService | |
| { | |
| public object PlaceOrder(Guid customerId, ShoppingCart shoppingCart) | |
| { | |
| throw new NotImplementedException(); | |
| } | |
| } |
This file contains hidden or 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
| [Test] | |
| public void WhenUserPlacesACorrectOrderThenAnOrderNumberShouldBeReturned() | |
| { | |
| //Arrange | |
| var shoppingCart = new ShoppingCart(); | |
| shoppingCart.Items.Add(new ShoppingCartItem { ItemId = Guid.NewGuid(), Quantity = 1 }); | |
| var customerId = Guid.NewGuid(); | |
| var expectedOrderId = Guid.NewGuid(); | |
| var orderService = new OrderService(); |
This file contains hidden or 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
| using System; | |
| using System.Linq; | |
| using NUnit.Framework; | |
| namespace TddStore.UnitTests | |
| { | |
| [TestFixture] | |
| class OrderServiceTests | |
| { | |
| [Test] |
This file contains hidden or 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
| using System; | |
| using System.ComponentModel; | |
| using System.Web; | |
| using System.Web.UI; | |
| using System.Web.UI.WebControls; | |
| using System.Web.UI.WebControls.WebParts; | |
| using Microsoft.SharePoint; | |
| using Microsoft.SharePoint.WebControls; | |
| namespace Araye.SharePoint.Webparts.HelloWorld.HelloWorld | |
| { |
This file contains hidden or 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
| <?xml version="1.0" encoding="utf-8"?> | |
| <Elements xmlns="http://schemas.microsoft.com/sharepoint/" > | |
| <Module Name="HelloWorld" List="113" Url="_catalogs/wp"> | |
| <File Path="HelloWorld\HelloWorld.webpart" Url="Araye.SharePoint.Webparts.HelloWorld_HelloWorld.webpart" Type="GhostableInLibrary"> | |
| <Property Name="Group" Value="Araye" /> | |
| </File> | |
| </Module> | |
| </Elements> |
This file contains hidden or 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
| using System; | |
| using System.Linq; | |
| namespace ThirtyDaysOfTDD.UnitTests | |
| { | |
| class OrderService | |
| { | |
| private ICustomerService _customerService; | |
| private ILoggingService _loggingService; | |
| private IOrderDataService _orderDataService; | |
| public OrderService(IOrderDataService orderDataService, ICustomerService customerService, ILoggingService loggingService) |