I see where you’re coming from, even though I don’t mind combining Act/Assert steps in this case.
The only thing I can think of is to store the actual delegate (here to FromPrinergyDateTime
) into a variable as the “act” step and then assert it:
[Test]
public void Should_not_convert_from_prinergy_date_time_sample2()
{
//Arrange
string testDate = "20121123120122";
//Act
ActualValueDelegate<object> testDelegate = () => testDate.FromPrinergyDateTime();
//Assert
Assert.That(testDelegate, Throws.TypeOf<FormatException>());
}
I get that the “act” step isn’t really acting, but rather defining what the action is. However, it does clearly delineate what action is being tested.