Skip to content

Instantly share code, notes, and snippets.

View Hameds's full-sized avatar
🎯
Focusing

Hamed Hameds

🎯
Focusing
View GitHub Profile
<appSettings>
<add key="ServerDrop.MaxRequestTimeInSeconds" value="300"/>
</appSettings>
private StringUtils _stringUtils;
[TestFixtureSetUp]
public void SetupStringUtilTests()
{
_stringUtils = new StringUtils();
}
using System;
using System.Linq;
using NUnit.Framework;
namespace ThirtyDaysOfTDD.UnitTests
{
[TestFixture]
public class StringUtilsTest
{
private StringUtils _stringUtils;
private StringUtils _stringUtils;
[SetUp]
public void SetupStringUtilTests()
{
_stringUtils = new StringUtils();
}
using System;
using System.Linq;
using NUnit.Framework;
namespace ThirtyDaysOfTDD.UnitTests
{
[TestFixture]
public class StringUtilsTest
{
[Test]
using System;
namespace ThirtyDaysOfTDD.UnitTests
{
public class StringUtils
{
public int FindNumberOfOccurences(string sentenceToScan, string characterToScanFor)
{
if (characterToScanFor.Length != 1)
{
using System;
namespace ThirtyDaysOfTDD.UnitTests
{
public class StringUtils
{
public int FindNumberOfOccurences(string sentenceToScan, string characterToScanFor)
{
try
{
using System;
namespace ThirtyDaysOfTDD.UnitTests
{
public class StringUtils
{
public int FindNumberOfOccurences(string sentenceToScan, string characterToScanFor)
{
try
{
using System;
namespace ThirtyDaysOfTDD.UnitTests
{
public class StringUtils
{
public int FindNumberOfOccurences(string sentenceToScan, string characterToScanFor)
{
throw new ArgumentException();
[Test]
[ExpectedException(typeof(ArgumentException))]
public void ShouldGetAnArgumentExceptionWhenCharacterToScanForIsLargerThanOneCharacter()
{
var sentenceToScan = "This test should throw an exception";
var characterToScanFor = "xx";
var stringUtils = new StringUtils();
stringUtils.FindNumberOfOccurences(sentenceToScan, characterToScanFor);
}