view Stocks/Stocks.Common.Tests.Unit/Core/ExtensionMethodsTests.cs @ 11:db71b2e0a216

Extension added (fails on Windows XP)
author stevenh7776 stevenhollidge@hotmail.com
date Tue, 21 Feb 2012 17:30:16 +0700
parents e5d46bb6cdb0
children
line wrap: on
line source

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);
    }
  }
}