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
using System; | |
namespace ThirtyDaysOfTDD.UnitTests | |
{ | |
public class StringUtils | |
{ | |
public int FindNumberOfOccurences(string sentenceToScan, string characterToScanFor) | |
{ | |
try | |
{ |
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
using System; | |
namespace ThirtyDaysOfTDD.UnitTests | |
{ | |
public class StringUtils | |
{ | |
public int FindNumberOfOccurences(string sentenceToScan, string characterToScanFor) | |
{ | |
try | |
{ |
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
using System; | |
namespace ThirtyDaysOfTDD.UnitTests | |
{ | |
public class StringUtils | |
{ | |
public int FindNumberOfOccurences(string sentenceToScan, string characterToScanFor) | |
{ | |
if (characterToScanFor.Length != 1) | |
{ |
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
using System; | |
using System.Linq; | |
using NUnit.Framework; | |
namespace ThirtyDaysOfTDD.UnitTests | |
{ | |
[TestFixture] | |
public class StringUtilsTest | |
{ | |
[Test] |
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
private StringUtils _stringUtils; | |
[SetUp] | |
public void SetupStringUtilTests() | |
{ | |
_stringUtils = new StringUtils(); | |
} |
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
using System; | |
using System.Linq; | |
using NUnit.Framework; | |
namespace ThirtyDaysOfTDD.UnitTests | |
{ | |
[TestFixture] | |
public class StringUtilsTest | |
{ | |
private StringUtils _stringUtils; |
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
using System; | |
using System.Linq; | |
namespace ThirtyDaysOfTDD.UnitTests | |
{ | |
class OrderService | |
{ | |
private ICustomerService _customerService; | |
private ILoggingService _loggingService; | |
private IOrderDataService _orderDataService; |
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
using System; | |
using System.Linq; | |
using NUnit.Framework; | |
namespace TddStore.UnitTests | |
{ | |
[TestFixture] | |
class OrderServiceTests | |
{ | |
[Test] |
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
[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 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) | |
{ |