Created
January 26, 2016 22:11
-
-
Save Vannevelj/ca710aee7b8b6ff05885 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
Test method VSDiagnostics.Test.Tests.General.TryCastUsingAsNotNullInsteadOfIsAsTests.TryCastWithoutUsingAsNotNull_BranchedIfStatement threw exception: | |
RoslynTester.Helpers.Testing.AssertionException: | |
Expected document is not the same as the resulting one. | |
Expected: | |
using System; | |
using System.Text; | |
namespace ConsoleApplication1 | |
{ | |
class MyClass | |
{ | |
private int oAsInt32; | |
void Method(object o) | |
{ | |
var oAsInt32 = o as int?; | |
var oAsString = o as string; | |
if (oAsInt32 != null) | |
{ | |
} | |
else if(oAsString != null) | |
{ | |
} | |
} | |
} | |
} | |
Actual: | |
using System; | |
using System.Text; | |
namespace ConsoleApplication1 | |
{ | |
class MyClass | |
{ | |
private int oAsInt32; | |
void Method(object o) | |
{ | |
var oAsInt32 = o as int?; | |
var oAsString = o as string; | |
if (oAsInt32 != null) | |
{ | |
} | |
else if(oAsString != null) | |
{ | |
} | |
} | |
} | |
} | |
at RoslynTester.Helpers.Testing.Assert.AreEqual(Object expected, Object actual, String message) | |
at RoslynTester.Helpers.CodeFixVerifier.VerifyFix(String language, DiagnosticAnalyzer analyzer, CodeFixProvider codeFixProvider, String oldSource, String newSource, Nullable`1 codeFixIndex, Boolean allowNewCompilerDiagnostics) | |
at RoslynTester.Helpers.CSharp.CSharpCodeFixVerifier.VerifyFix(String oldSource, String newSource, Nullable`1 codeFixIndex, Boolean allowNewCompilerDiagnostics) | |
at VSDiagnostics.Test.Tests.General.TryCastUsingAsNotNullInsteadOfIsAsTests.TryCastWithoutUsingAsNotNull_BranchedIfStatement() in TryCastUsingAsNotNullInsteadOfIsAsTests.cs: line 1344 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment