Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert.IsNotInstanceOfType fails on value null #617

Closed
Saeras opened this issue Jun 6, 2019 · 2 comments
Closed

Assert.IsNotInstanceOfType fails on value null #617

Saeras opened this issue Jun 6, 2019 · 2 comments
Assignees

Comments

@Saeras
Copy link

Saeras commented Jun 6, 2019

Description

Assert.IsInstanceOfType succeeds when value is null, while the MSDN specifies it should throw an error.
AssertFailedException : 'value is null or expectedType is not found in the inheritance hierarchy of value.'
This behavior was broken under issue #178 where Assert.IsNotInstanceOfType was incorrectly changed to fail when the value is null.

Steps to reproduce

Create a standard .net core test project from visual studio 2017, and create a dummy class. then use the following method:
public void TestMethod1() { Assert.IsNotInstanceOfType(null, typeof(Dummy)); }

Expected behavior

The test should succeed

Actual behavior

The test throws AssertFailedException and fails

Environment

Windows 10 version 1709 (build 16299.125)
Visual Studio version 15.9.11
MSTest.TestAdapter version 1.3.2
MSTest.TestFramework version 1.3.2

@ShreyasRmsft
Copy link
Member

@Saeras thank you for reporting this. We will be fixing this.

@ShreyasRmsft ShreyasRmsft self-assigned this Jun 17, 2019
@ShreyasRmsft
Copy link
Member

ShreyasRmsft commented Jun 18, 2019

Fixed in PR #622

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants