public GetMethodContext ( object testObject ) : ITestMethodContext | ||
testObject | object | /// The test object. /// |
리턴 | ITestMethodContext |
public void GetMethodContextWithNullTestObjectThrows() { var sut = new StaticTestCaseCommandContext( Mocked.Of<IMethodInfo>(), Mocked.Of<IMethodInfo>(), Mocked.Of<ISpecimenBuilderFactory>(), new object[0]); Assert.Throws<ArgumentNullException>(() => sut.GetMethodContext(null)); }
public void GetMethodContextReturnsCorrectResult() { var testMethod = Mocked.Of<IMethodInfo>(); var actualMethod = Mocked.Of<IMethodInfo>(); var sut = new StaticTestCaseCommandContext( testMethod, actualMethod, Mocked.Of<ISpecimenBuilderFactory>(), new object[0]); var testObject = new object(); var actual = sut.GetMethodContext(testObject); actual.AssertHasCorrectValues(testMethod.MethodInfo, actualMethod.MethodInfo, testObject, null); }