private ToStarting_ShouldThrowInvalidOperationExceptionAndNotChangeStatus ( ) : void | ||
return | void |
public void ToStarting_ShouldThrowInvalidOperationExceptionAndNotChangeStatus()
{
var status = ForwardedPortStatus.Stopping;
try
{
ForwardedPortStatus.ToStarting(ref status);
Assert.Fail();
}
catch (InvalidOperationException ex)
{
Assert.IsNull(ex.InnerException);
Assert.AreEqual(
string.Format("Forwarded port cannot transition from '{0}' to '{1}'.",
ForwardedPortStatus.Stopping,
ForwardedPortStatus.Starting),
ex.Message);
}
Assert.AreEqual(ForwardedPortStatus.Stopping, status);
}