public void SelectConstructorsFromNullTypeThrows() { // Fixture setup var sut = new RhinoMockConstructorQuery(); // Exercise system and verify outcome Assert.Throws <ArgumentNullException>(() => sut.SelectConstructors(null)); // Teardown }
public void SelectReturnsCorrectNumberOfMethodsForInterface(Type t) { // Fixture setup var sut = new RhinoMockConstructorQuery(); // Exercise system var result = sut.SelectConstructors(t); // Verify outcome Assert.Equal(1, result.Count()); // Teardown }
public void SelectReturnsCorrectResultForInterface(Type t) { // Fixture setup var sut = new RhinoMockConstructorQuery(); // Exercise system var result = sut.SelectConstructors(t); // Verify outcome var method = Assert.IsAssignableFrom <RhinoMockConstructorMethod>(result.Single()); Assert.Equal(t, method.MockTargetType); // Teardown }
public void SelectReturnsCorrectResultForNonInterfaces(Type t) { // Fixture setup var expectedCount = t.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).Length; var sut = new RhinoMockConstructorQuery(); // Exercise system var result = sut.SelectConstructors(t); // Verify outcome Assert.Equal(expectedCount, result.Count()); // Teardown }
public void SelectReturnsResultWithNoParametersForInterface(Type t) { // Fixture setup var sut = new RhinoMockConstructorQuery(); // Exercise system var result = sut.SelectConstructors(t); // Verify outcome var method = Assert.IsAssignableFrom <RhinoMockConstructorMethod>(result.Single()); Assert.Empty(method.Parameters); // Teardown }