Exemplo n.º 1
0
        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");
        }
Exemplo n.º 2
0
        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}.");
            }
        }
Exemplo n.º 3
0
        public void AreEqualOk()
        {
            const string parameterName = "parameterName";

            InternalContract.RequireAreEqual(10, 5 * 2, parameterName);
        }