public void Equals_ShouldReturnFalseWhenOtherIsNull() { const ForwardedPortStatus other = null; var actual = ForwardedPortStatus.Stopped.Equals(other); Assert.IsFalse(actual); }
public void EqualityOperator_ShouldReturnFalseWhenRightIsNull() { var left = ForwardedPortStatus.Stopped; const ForwardedPortStatus right = null; var actual = left == right; Assert.IsFalse(actual); }
public void ToStarting_ShouldReturnTrueAndChangeStatusToStarting() { var status = ForwardedPortStatus.Stopped; var actual = ForwardedPortStatus.ToStarting(ref status); Assert.IsTrue(actual); Assert.AreEqual(ForwardedPortStatus.Starting, status); }
public void InEqualityOperator_ShouldReturnTrueWhenLeftIsNull() { const ForwardedPortStatus left = null; var right = ForwardedPortStatus.Stopped; var actual = left != right; Assert.IsTrue(actual); }
public void ToStopping_ShouldReturnFalseAndNotChangeStatus() { var status = ForwardedPortStatus.Stopped; var actual = ForwardedPortStatus.ToStopping(ref status); Assert.IsFalse(actual); Assert.AreEqual(ForwardedPortStatus.Stopped, status); }
public void InEqualityOperator_ShouldReturnTrueWhenRightIsNull() { var left = ForwardedPortStatus.Started; const ForwardedPortStatus right = null; var actual = left != right; Assert.IsTrue(actual); }
public void EqualityOperator_ShouldReturnFalseWhenLeftIsNull() { const ForwardedPortStatus left = null; var right = ForwardedPortStatus.Started; var actual = left == right; Assert.IsFalse(actual); }
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); }