Exemple #1
0
            public void When_object_type_is_same_as_expected_type_but_in_different_assembly_it_should_fail_with_assembly_qualified_name()
            {
                // Arrange
                var typeFromOtherAssembly =
                    new AssemblyA.ClassA().ReturnClassC();

                // Act
#pragma warning disable 436 // disable the warning on conflicting types, as this is the intention for the spec

                Action act = () =>
                             typeFromOtherAssembly.Should().BeOfType <AssemblyB.ClassC>();

#pragma warning restore 436

                // Assert
                act.Should().Throw <XunitException>()
                .WithMessage("Expected type to be [AssemblyB.ClassC, FluentAssertions.Specs*], but found [AssemblyB.ClassC, AssemblyB*].");
            }