I was attempting to use FluentAssertions with my ASP.NET MVC project, when I encountered the following error message:
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'string' does not contain a definition for 'Should'
I was essentially trying to execute the following code:
However, no matter what I did, I could not get this code to execute successfully!
Therefore, in the end, I ended up just using the standard MSTest assertions as follows:
Unfortunately, that was the only viable solution for me. If you found an alternative solution, feel free to share your solution in the comments below!!
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'string' does not contain a definition for 'Should'
I was essentially trying to execute the following code:
result.ViewBag.Message.ToString().Should().ShouldBeEquivalentTo(expected);
However, no matter what I did, I could not get this code to execute successfully!
Therefore, in the end, I ended up just using the standard MSTest assertions as follows:
Assert.AreEqual(expected, result.ViewBag.Message);
Unfortunately, that was the only viable solution for me. If you found an alternative solution, feel free to share your solution in the comments below!!
Монтаж систем вентиляции и дымоудаления производственных цехов, административных и торговых зданий, объектов нефтегазовой отрасли, больниц, детских садов и школ. Цена и прайс-лист, стоимость отдельных видов работ по установке вентиляции. Монтаж вентиляции производится сотрудниками, имеющими аттестацию в промышленной безопасности, что позволяет нам проводить работы в опасных и взрывоопасных промышленных цехах, на объектах нефтегазовой и химической промышленности.
ReplyDelete