Created
December 30, 2018 07:04
-
-
Save rubenrorije/2caf183ffb7e598546d220797252795c 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 FluentAssertions; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace FluentAssertion.Tests | |
{ | |
[TestClass] | |
public class FluentAssertionTests | |
{ | |
[TestMethod] | |
public void Trailing_Backslash_In_Expected_Result_Should_Not_Be_Removed() | |
{ | |
"A".Should().Be("A\\"); | |
/* | |
* Output: | |
* Expected string to be "A" with a length of 2, but "A" has a length of 1, differs near "A" (index 0). | |
* Expected Output: | |
* Expected string to be "A\" with a length of 2, but "A" has a length of 1, differs near "A" (index 0). | |
*/ | |
} | |
[TestMethod] | |
public void MyTestMethod() | |
{ | |
"A".Should().Be("AB"); | |
} | |
[TestMethod] | |
public void Trailing_Backslash_In_Subject_Should_Not_Be_Removed() | |
{ | |
"A\\".Should().Be("A"); | |
/* | |
* Output: | |
* Expected string to be "A" with a length of 1, but "A\" has a length of 2, differs near "" (index 1). | |
* Expected Output: | |
* Expected string to be "A" with a length of 1, but "A\" has a length of 2, differs near "\" (index 1). | |
*/ | |
} | |
[TestMethod] | |
public void Literal_Backslash_Followed_By_R_Is_Not_Escaped_In_Expected_Result() | |
{ | |
"\\r".Should().Be("r"); | |
/* | |
* Output: | |
Expected string to be "r" with a length of 1, but " | |
" has a length of 2, differs near " | |
" (index 0). | |
* Expected output: | |
* Expected string to be "r" with a length of 1, but "\r" has a length of 2, differs near "\" (index 0). | |
*/ | |
} | |
[TestMethod] | |
public void Literal_Backslash_Followed_By_R_Is_Not_Escaped_In_Subject() | |
{ | |
"r".Should().Be("\\r"); | |
/* | |
* Output: Expected string to be " | |
" with a length of 2, but "r" has a length of 1, differs near "r" (index 0). | |
* Expected output: | |
* Expected string to be "\r" with a length of 2, but "r" has a length of 1, differs near "r" (index 0). | |
*/ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment