public void TestableSutIsSut() { // Arrange // Act var sut = new DelegatingIdiomaticAssertion(); // Assert Assert.IsAssignableFrom <IdiomaticAssertion>(sut); }
public void VerifyNullAssemblyThrows() { // Arrange var sut = new DelegatingIdiomaticAssertion(); // Act & Assert Assert.Throws <ArgumentNullException>(() => sut.Verify((Assembly)null)); }
public void VerifyNullPropertyInfoArrayThrows() { // Arrange var sut = new DelegatingIdiomaticAssertion(); // Act & Assert Assert.Throws <ArgumentNullException>(() => sut.Verify((PropertyInfo[])null)); }
public void VerifyConstructorInfoDoesNotThrow(Type type) { // Arrange var ctor = type.GetConstructors().First(); var sut = new DelegatingIdiomaticAssertion(); // Act & Assert Assert.Null(Record.Exception(() => sut.Verify(ctor))); }
public void VerifyNullAssemblyThrows() { // Fixture setup var sut = new DelegatingIdiomaticAssertion(); // Exercise system and verify outcome Assert.Throws <ArgumentNullException>(() => sut.Verify((Assembly)null)); // Teardown }
public void VerifyFieldInfoDoesNotThrow(Type type) { // Arrange var field = type.GetFields().First(); var sut = new DelegatingIdiomaticAssertion(); // Act & Assert Assert.Null(Record.Exception(() => sut.Verify(field))); }
public void VerifyMethodInfoDoesNotThrow(Type type) { // Arrange var method = type.GetMethods().Except(type.GetProperties().SelectMany(p => p.GetAccessors())).First(); var sut = new DelegatingIdiomaticAssertion(); // Act & Assert Assert.Null(Record.Exception(() => sut.Verify(method))); }
public void VerifyPropertyInfoDoesNotThrow(Type type) { // Arrange var property = type.GetProperties().First(); var sut = new DelegatingIdiomaticAssertion(); // Act & Assert Assert.Null(Record.Exception(() => sut.Verify(property))); }
public void TestableSutIsSut() { // Fixture setup // Exercise system var sut = new DelegatingIdiomaticAssertion(); // Verify outcome Assert.IsAssignableFrom <IdiomaticAssertion>(sut); // Teardown }
public void VerifyPropertyInfoDoesNotThrow(Type type) { // Fixture setup var property = type.GetProperties().First(); var sut = new DelegatingIdiomaticAssertion(); // Exercise system and verify outcome Assert.Null(Record.Exception(() => sut.Verify(property))); // Teardown }
public void VerifyMethodInfoDoesNotThrow(Type type) { // Fixture setup var method = type.GetMethods().Except(type.GetProperties().SelectMany(p => p.GetAccessors())).First(); var sut = new DelegatingIdiomaticAssertion(); // Exercise system and verify outcome Assert.Null(Record.Exception(() => sut.Verify(method))); // Teardown }
public void VerifyConstructorInfoDoesNotThrow(Type type) { // Fixture setup var ctor = type.GetConstructors().First(); var sut = new DelegatingIdiomaticAssertion(); // Exercise system and verify outcome Assert.Null(Record.Exception(() => sut.Verify(ctor))); // Teardown }
public void VerifyTypeCorrectlyInvokesConstructorsVerify(Type type) { // Arrange var expectedCtors = type.GetConstructors(); var mockVerified = false; var sut = new DelegatingIdiomaticAssertion { OnConstructorInfoArrayVerify = c => mockVerified = expectedCtors.IsEquivalentTo(c) }; // Act sut.Verify(type); // Assert Assert.True(mockVerified, "Mock verified."); }
public void VerifyTypeCorrectlyInvokesMethodsVerify(Type type) { // Arrange var expectedMethods = type.GetMethods().Except(type.GetProperties().SelectMany(p => p.GetAccessors())); var mockVerified = false; var sut = new DelegatingIdiomaticAssertion { OnMethodInfosVerify = m => mockVerified = expectedMethods.IsEquivalentTo(m) }; // Act sut.Verify(type); // Assert Assert.True(mockVerified, "Mock verified."); }
public void VerifyTypeCorrectlyInvokesFieldsVerify(Type type) { // Arrange var expectedFields = type.GetFields(); var mockVerified = false; var sut = new DelegatingIdiomaticAssertion { OnFieldInfoArrayVerify = p => mockVerified = expectedFields.IsEquivalentTo(p) }; // Act sut.Verify(type); // Assert Assert.True(mockVerified, "Mock verified."); }
public void VerifyConstructorInfosCorrectlyInvokesNextVerify(Type type) { // Arrange var ctors = type.GetConstructors().AsEnumerable(); var observedConstructors = new List <ConstructorInfo>(); var sut = new DelegatingIdiomaticAssertion { OnConstructorInfoVerify = observedConstructors.Add }; // Act sut.Verify(ctors); // Assert Assert.True(ctors.SequenceEqual(observedConstructors)); }
public void VerifyPropertyInfosCorrectlyInvokesNextVerify(Type type) { // Arrange var properties = type.GetProperties().AsEnumerable(); var observedProperties = new List <PropertyInfo>(); var sut = new DelegatingIdiomaticAssertion { OnPropertyInfoVerify = observedProperties.Add }; // Act sut.Verify(properties); // Assert Assert.True(properties.SequenceEqual(observedProperties)); }
public void VerifyMethodInfosCorrectlyInvokesNextVerify(Type type) { // Arrange var methods = type.GetMethods().Except(type.GetProperties().SelectMany(p => p.GetAccessors())); var observedMethods = new List <MethodInfo>(); var sut = new DelegatingIdiomaticAssertion { OnMethodInfoVerify = observedMethods.Add }; // Act sut.Verify(methods); // Assert Assert.True(methods.SequenceEqual(observedMethods)); }
public void VerifyFieldInfosCorrectlyInvokesNextVerify(Type type) { // Arrange var fields = type.GetFields().Select(f => f); var observedFields = new List <FieldInfo>(); var sut = new DelegatingIdiomaticAssertion { OnFieldInfoVerify = observedFields.Add }; // Act sut.Verify(fields); // Assert Assert.True(fields.SequenceEqual(observedFields)); }
public void VerifyMemberInfoCorrectlyInvokesFieldInfoVerify(Type type) { // Arrange var member = type.GetFields().Cast <MemberInfo>().First(); var mockVerified = false; var sut = new DelegatingIdiomaticAssertion { OnFieldInfoVerify = f => mockVerified = f.Equals(member) }; // Act sut.Verify(member); // Assert Assert.True(mockVerified, "Mock verified."); }
public void VerifyMembersCorrectlyInvokesNextVerify(Type type) { // Arrange var members = type.GetMembers().AsEnumerable(); var observedMembers = new List <MemberInfo>(); var sut = new DelegatingIdiomaticAssertion { OnMemberInfoVerify = observedMembers.Add }; // Act sut.Verify(members); // Assert Assert.True(members.SequenceEqual(observedMembers)); }
public void VerifyMemberInfoArrayCorrectlyInvokesNextVerify(Type type) { // Fixture setup var members = type.GetMembers(); var observedMembers = new List <MemberInfo>(); var sut = new DelegatingIdiomaticAssertion { OnMemberInfoVerify = observedMembers.Add }; // Exercise system sut.Verify(members); // Verify outcome Assert.True(members.SequenceEqual(observedMembers)); // Teardown }
public void VerifyConstructorInfosCorrectlyInvokesNextVerify(Type type) { // Fixture setup var ctors = type.GetConstructors().AsEnumerable(); var observedConstructors = new List <ConstructorInfo>(); var sut = new DelegatingIdiomaticAssertion { OnConstructorInfoVerify = observedConstructors.Add }; // Exercise system sut.Verify(ctors); // Verify outcome Assert.True(ctors.SequenceEqual(observedConstructors)); // Teardown }
public void VerifyAssembliesCorrectlyInvokesNextVerify() { // Arrange var assemblies = new[] { typeof(IdiomaticAssertion).GetType().Assembly, this.GetType().Assembly, typeof(Fixture).GetType().Assembly }.AsEnumerable(); var observedAssemblies = new List <Assembly>(); var sut = new DelegatingIdiomaticAssertion { OnAssemblyVerify = observedAssemblies.Add }; // Act sut.Verify(assemblies); // Assert Assert.True(assemblies.SequenceEqual(observedAssemblies)); }
public void VerifyFieldInfosCorrectlyInvokesNextVerify(Type type) { // Fixture setup var fields = type.GetFields().Select(f => f); var observedFields = new List <FieldInfo>(); var sut = new DelegatingIdiomaticAssertion { OnFieldInfoVerify = observedFields.Add }; // Exercise system sut.Verify(fields); // Verify outcome Assert.True(fields.SequenceEqual(observedFields)); // Teardown }
public void VerifyMethodInfosCorrectlyInvokesNextVerify(Type type) { // Fixture setup var methods = type.GetMethods().Except(type.GetProperties().SelectMany(p => p.GetAccessors())); var observedMethods = new List <MethodInfo>(); var sut = new DelegatingIdiomaticAssertion { OnMethodInfoVerify = observedMethods.Add }; // Exercise system sut.Verify(methods); // Verify outcome Assert.True(methods.SequenceEqual(observedMethods)); // Teardown }
public void VerifyPropertyInfosCorrectlyInvokesNextVerify(Type type) { // Fixture setup var properties = type.GetProperties().AsEnumerable(); var observedProperties = new List <PropertyInfo>(); var sut = new DelegatingIdiomaticAssertion { OnPropertyInfoVerify = observedProperties.Add }; // Exercise system sut.Verify(properties); // Verify outcome Assert.True(properties.SequenceEqual(observedProperties)); // Teardown }
public void VerifyTypesCorrectlyInvokesNextVerify() { // Arrange var types = new[] { typeof(string), typeof(int), typeof(Version) }.AsEnumerable(); var observedTypes = new List <Type>(); var sut = new DelegatingIdiomaticAssertion { OnTypeVerify = observedTypes.Add }; // Act sut.Verify(types); // Assert Assert.True(types.SequenceEqual(observedTypes)); }
public void VerifyMemberInfoCorrectlyInvokesFieldInfoVerify(Type type) { // Fixture setup var member = type.GetFields().Cast <MemberInfo>().First(); var mockVerified = false; var sut = new DelegatingIdiomaticAssertion { OnFieldInfoVerify = f => mockVerified = f.Equals(member) }; // Exercise system sut.Verify(member); // Verify outcome Assert.True(mockVerified, "Mock verified."); // Teardown }
public void VerifyTypeCorrectlyInvokesFieldsVerify(Type type) { // Fixture setup var expectedFields = type.GetFields(); var mockVerified = false; var sut = new DelegatingIdiomaticAssertion { OnFieldInfoArrayVerify = p => mockVerified = expectedFields.IsEquivalentTo(p) }; // Exercise system sut.Verify(type); // Verify outcome Assert.True(mockVerified, "Mock verified."); // Teardown }