示例#1
0
        public void SpecificLength_AssertString_LengthDoesNotMatch_Error(int length, string value)
        {
            SpecificLength specificLength = new SpecificLength(length);

            var exception = Assert.Throws <Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException>(()
                                                                                                               => specificLength.Assert(_testFramework, value, "Custom message"));

            Assert.AreEqual($"Assert.AreEqual failed. Expected:<{length}>. Actual:<{value?.Length ?? 0}>. Custom message has an unexpected length", exception.Message);
        }
示例#2
0
        public void SpecificLength_AssertString_LengthMatches_NoError(int length, string value)
        {
            SpecificLength specificLength = new SpecificLength(length);

            Assert.DoesNotThrow(() => specificLength.Assert(_testFramework, value, "Custom message"));
        }