Example #1
0
        public void BeCreatedResult_Throws_When_Subject_Isnt_ContentResult()
        {
            // Arrange
            var target = new DummyResult();
            var sut    = new ResultAssertions(target);

            // Act & Assert
            sut.Invoking(x => x.BeCreatedResult())
            .Should()
            .Throw <XunitException>()
            .WithMessage($"Expected result to be of type Microsoft.AspNetCore.Mvc.ContentResult, but found {target.GetType().FullName}.");
        }