public void Debug_Fail_does_not_throw_when_no_callback_has_been_registered() { //Arrange //Act DebugCore.Fail("message"); //Assert Assert.Pass(); }
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(); }
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); }
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); }