Created
October 14, 2009 23:39
-
-
Save jdiamond/210497 to your computer and use it in GitHub Desktop.
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 NUnit.Framework; | |
namespace BehaveN.Tests | |
{ | |
[TestFixture] | |
public class Describe_NameParser | |
{ | |
[Test] | |
public void it_should_throw_an_exception_when_parsing_null() | |
{ | |
(new Action(() => NameParser.Parse((string)null))).Should().Throw<ArgumentNullException>(); | |
} | |
[Test] | |
public void it_should_return_an_empty_string_when_parsing_an_empty_string() | |
{ | |
string result = NameParser.Parse(""); | |
result.Should().Be.EqualTo(""); | |
} | |
[Test] | |
public void it_should_return_the_same_string_when_parsing_a_single_word() | |
{ | |
string result = NameParser.Parse("foo"); | |
result.Should().Be.EqualTo("foo"); | |
} | |
[Test] | |
public void it_should_return_two_strings_when_parsing_words_separated_by_semicolons() | |
{ | |
string result = NameParser.Parse("foo_bar"); | |
result.Should().Be.EqualTo("foo bar"); | |
} | |
[Test] | |
public void it_should_return_two_strings_when_parsing_a_words_using_pascal_case() | |
{ | |
string result = NameParser.Parse("FooBar"); | |
result.Should().Be.EqualTo("Foo Bar"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment