0
|
1 using System;
|
|
2 using Stocks.Common.Core;
|
|
3 using Xunit;
|
|
4
|
|
5 namespace Stocks.Common.Tests.Unit.Core
|
|
6 {
|
|
7 public class ExtensionMethodsTests
|
|
8 {
|
|
9 [Fact]
|
|
10 public void Expecting_success()
|
|
11 {
|
|
12 string value = "ABCD";
|
|
13 string expected = "DCBA";
|
|
14 string actual = value.Reverse();
|
|
15 Assert.Equal(expected, actual);
|
|
16 }
|
|
17
|
|
18 [Fact]
|
|
19 public void Expecting_success_with_null()
|
|
20 {
|
|
21 string value = null;
|
|
22 string expected = null;
|
|
23 string actual = value.Reverse();
|
|
24 Assert.Equal(expected, actual);
|
|
25 }
|
|
26
|
|
27 [Fact]
|
|
28 public void Expecting_success_with_zero_length_string()
|
|
29 {
|
|
30 string value = string.Empty;
|
|
31 string expected = string.Empty;
|
|
32 string actual = value.Reverse();
|
|
33 Assert.Equal(expected, actual);
|
|
34 }
|
|
35
|
|
36 [Fact]
|
|
37 public void Expecting_success_with_space()
|
|
38 {
|
|
39 string value = "steven hollidge";
|
|
40 string expected = "egdilloh nevets";
|
|
41 string actual = value.Reverse();
|
|
42 Assert.Equal(expected, actual);
|
|
43 }
|
|
44 }
|
|
45 }
|