Ejemplo n.º 1
0
        public void Debug_Fail_does_not_throw_when_no_callback_has_been_registered()
        {
            //Arrange

            //Act
            DebugCore.Fail("message");

            //Assert
            Assert.Pass();
        }
Ejemplo n.º 2
0
        public void Debug_Fail_does_not_throw_when_ignore_callback_has_been_registered()
        {
            //Arrange
            DebugCore.SetAssertionFailedCallback((res) => AssertionResponse.Ignore);

            //Act
            DebugCore.Fail("message");

            //Assert
            Assert.Pass();
        }
Ejemplo n.º 3
0
        public void Debug_Fail_provide_expected_SourceMethod()
        {
            //Arrange
            var count = 0;

            DebugCore.SetAssertionFailedCallback((res) =>
            {
                Interlocked.Increment(ref count);
                Assert.AreEqual(nameof(Debug_Fail_provide_expected_SourceMethod), res.SourceMethod);
                return(AssertionResponse.Ignore);
            });

            //Act
            DebugCore.Fail("message");

            //Assert
            Assert.AreEqual(1, count);
        }
Ejemplo n.º 4
0
        public void Debug_Fail_provide_expected_stackTrace()
        {
            //Arrange
            var count = 0;

            DebugCore.SetAssertionFailedCallback((res) =>
            {
                Interlocked.Increment(ref count);
                Assert.IsNotEmpty(res.StackTrace);
                return(AssertionResponse.Ignore);
            });

            //Act
            DebugCore.Fail("message");

            //Assert
            Assert.AreEqual(1, count);
        }