fix test
This commit is contained in:
Родитель
67bcffab06
Коммит
fa9f92dc3b
|
@ -1000,22 +1000,4 @@ namespace Telerik.JustMock.Tests
|
|||
IEnumerable<string> GetValuesSince(DateTime since);
|
||||
}
|
||||
}
|
||||
|
||||
[TestClass]
|
||||
public class MockingContextFixture
|
||||
{
|
||||
[TestMethod]
|
||||
public void ShouldDisallowCallingOfTestMethodFromAnotherInner()
|
||||
{
|
||||
Mock.Create<object>();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void ShouldDisallowCallingOfTestMethodFromAnother()
|
||||
{
|
||||
var ex = Assert.Throws<MockException>(() => ShouldDisallowCallingOfTestMethodFromAnotherInner());
|
||||
var expected = "Calling one test method from another could result in unexpected behavior and must be avoided. Extract common mocking logic in a non-test method.";
|
||||
Assert.Equal(expected, ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,7 +114,8 @@ namespace Telerik.JustMock.Core.Context
|
|||
var allTestMethods = q.Distinct().ToArray();
|
||||
if (allTestMethods.Length > 1)
|
||||
{
|
||||
Debug.WriteLine("Calling one test method from another could result in unexpected behavior and must be avoided. Extract common mocking logic in a non-test method. At:\n" + stackTrace);
|
||||
var message = "Calling one test method from another could result in unexpected behavior and must be avoided. Extract common mocking logic to a non-test method. At:\n" + stackTrace;
|
||||
DebugView.DebugTrace(message);
|
||||
}
|
||||
var testMethod = allTestMethods.FirstOrDefault();
|
||||
|
||||
|
|
|
@ -182,6 +182,8 @@ namespace Telerik.JustMock
|
|||
DynamicProxyMockFactory.SaveAssembly();
|
||||
}
|
||||
#endif
|
||||
|
||||
internal static Action<string> DebugTrace = s => System.Diagnostics.Trace.WriteLine(s);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче