-
Notifications
You must be signed in to change notification settings - Fork 731
Closed
Labels
Description
Description
Assertion of type after And fails
Complete minimal example reproducing the issue
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
namespace FluentAssertions
{
[TestClass]
public class FluentAssertionTest
{
private Exception exception = new ArgumentNullException();
[TestMethod]
public void This_should_work_but_it_does_not()
{
// TestMethod fails: Expected type to be System.ArgumentNullException,
// but found FluentAssertions.Primitives.ObjectAssertions.
exception.Should().NotBeNull().And.Should().BeOfType<ArgumentNullException>();
}
[TestMethod]
public void This_works()
{
exception.Should().NotBeNull();
exception.Should().BeOfType<ArgumentNullException>();
}
}
}Expected behavior:
Both test method to work
Actual behavior:
Test method with And (This_should_work_but_it_does_not) is not working
Versions
FluentAssertions version: 5.10.3 (and 6.0.0-beta0001)
.NET Core 3.1