Skip to content

Instantly share code, notes, and snippets.

View Hameds's full-sized avatar
🎯
Focusing

Hamed Hameds

🎯
Focusing
View GitHub Profile
[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>();
public object PlaceOrder(Guid customerId, ShoppingCart shoppingCart)
{
var order = new Order();
return _orderDataService.Save(order);
}
using System;
using System.Linq;
using NUnit.Framework;
using TddStore.Core;
using Telerik.JustMock;
namespace TddStore.UnitTests
{
[TestFixture]
class OrderServiceTests
{
using System;
namespace TddStore.Core
{
public class OrderService
{
private IOrderDataService _orderDataService;
public OrderService(IOrderDataService orderDataService)
{
public class OrderService
{
public object PlaceOrder(Guid customerId, ShoppingCart shoppingCart)
{
throw new NotImplementedException();
}
}
[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();
using System;
using System.Linq;
using NUnit.Framework;
namespace TddStore.UnitTests
{
[TestFixture]
class OrderServiceTests
{
[Test]
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
{
<?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>
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)