28
loading...
This website collects cookies to deliver better user experience
Assert.AreEqual(31, daysInJune);
using FluentAssertions;
. . .
daysInJune.Should().Be(31);
string stateName = "OHIO";
stateName.Should().StartWith("O").And.EndWith("O").And.Contain("HI");
[ExpectedException(type)]
attribute. Among other shortcomings, it doesn't let you test the exception message.subject.Invoking(x => x.Foo("Hello"))
.Should().Throw<InvalidOperationException>()
.WithMessage("Hello is not allowed at this moment");
Action action = () => x.Foo("Hello");
action
.Should().Throw<InvalidOperationException>()
.WithMessage("Hello is not allowed at this moment");
string correctNameSpelling = "Bryan";
Assert.AreEqual("Brian", correctNameSpelling);
Assert.AreEqual failed. Expected:<Brian>. Actual:<Bryan>.
string correctNameSpelling = "Bryan";
correctNameSpelling.Should().Be("Brian");
Expected correctNameSpelling to be "Brian", but "Bryan" differs near "yan" (index 2).