public void NullParameterNameIsOkWhenThereIsACustomMessage() { var value = "A"; // ReSharper disable once ExpressionIsAlwaysNull InternalContract.RequireAreEqual(value, value, null, "This assertion has a custom message, so null parameter name is OK"); }
public void AreEqualFail() { const string parameterName = "parameterName"; try { InternalContract.RequireAreEqual("Knoll", "Tott", parameterName); UT.Assert.Fail("An exception should have been thrown"); } catch (FulcrumContractException fulcrumException) { UT.Assert.IsTrue(fulcrumException.TechnicalMessage.Contains(parameterName)); } catch (Exception e) { UT.Assert.Fail($"Expected a specific FulcrumException but got {e.GetType().FullName}."); } }
public void AreEqualOk() { const string parameterName = "parameterName"; InternalContract.RequireAreEqual(10, 5 * 2, parameterName); }