diff Stocks/Stocks.Common.Tests.Unit/Core/ExtensionMethodsTests.cs @ 0:e5d46bb6cdb0

Initial commit
author adminSH stevenhollidge@hotmail.com
date Mon, 20 Feb 2012 13:52:35 +0700
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Stocks/Stocks.Common.Tests.Unit/Core/ExtensionMethodsTests.cs	Mon Feb 20 13:52:35 2012 +0700
@@ -0,0 +1,45 @@
+using System;
+using Stocks.Common.Core;
+using Xunit;
+
+namespace Stocks.Common.Tests.Unit.Core
+{
+  public class ExtensionMethodsTests
+  {
+    [Fact]
+    public void Expecting_success()
+    {
+      string value = "ABCD";
+      string expected = "DCBA";
+      string actual = value.Reverse();
+      Assert.Equal(expected, actual);
+    }
+
+    [Fact]
+    public void Expecting_success_with_null()
+    {
+      string value = null;
+      string expected = null;
+      string actual = value.Reverse();
+      Assert.Equal(expected, actual);
+    }
+
+    [Fact]
+    public void Expecting_success_with_zero_length_string()
+    {
+      string value = string.Empty;
+      string expected = string.Empty;
+      string actual = value.Reverse();
+      Assert.Equal(expected, actual);
+    }
+
+    [Fact]
+    public void Expecting_success_with_space()
+    {
+      string value = "steven hollidge";
+      string expected = "egdilloh nevets";
+      string actual = value.Reverse();
+      Assert.Equal(expected, actual);
+    }
+  }
+}