public void Get_generic_attribute_from_type() { // Act AttributeFixture attribute = AttributeCache.GetAttribute <AttributeFixture>(typeof(TypePoolFixture)); // Assert Assert.IsNotNull(attribute); }
public void Get_generic_attribute_on_type_with_predicate() { // Act AttributeFixture attribute = AttributeCache.GetAttribute <AttributeFixture>(typeof(TypePoolFixture), null, a => a.IsEnabled); // Assert Assert.IsNotNull(attribute); Assert.IsTrue(attribute.IsEnabled); }
public void Get_generic_attribute_from_instance() { // Arrange var fixture = new TypePoolFixture(); // Act AttributeFixture attribute = AttributeCache.GetAttribute <AttributeFixture, TypePoolFixture>(); // Assert Assert.IsNotNull(attribute); }
public void Get_generic_single_attribute_from_instance_property() { // Arrange var fixture = new TypePoolFixture(); var property = typeof(TypePoolFixture).GetProperty(fixture.GetPropertyName(p => p.PropertyWithAttribute)); // Act AttributeFixture attribute = AttributeCache.GetAttribute <AttributeFixture, TypePoolFixture>(property, fixture); // Assert Assert.IsNotNull(attribute); }
public void Get_generic_attribute_from_null_property_and_null_instance_with_predicate() { // Arrange var fixture = new TypePoolFixture(); var property = typeof(TypePoolFixture).GetProperty(fixture.GetPropertyName(p => p.PropertyWithAttribute)); // Act AttributeFixture attribute = AttributeCache.GetAttribute <AttributeFixture, TypePoolFixture>( null, null, a => a.IsEnabled); // Assert Assert.IsNotNull(attribute); }
public void Get_generic_attribute_from_property_on_type_with_predicate() { // Arrange var fixture = new TypePoolFixture(); var property = typeof(TypePoolFixture).GetProperty(fixture.GetPropertyName(p => p.PropertyWithAttribute)); // Act AttributeFixture attribute = AttributeCache.GetAttribute <AttributeFixture>(typeof(TypePoolFixture), property, a => a.IsEnabled); // Assert Assert.IsNotNull(attribute); Assert.IsTrue(attribute.IsEnabled); }
public void Get_generic_attribute_on_null_type() { // Act AttributeFixture attribute = AttributeCache.GetAttribute <AttributeFixture>(null, null, null); }
public TodoItemControllerAttributesTests(AttributeFixture <TodoItemController> attribute) { _attribute = attribute ?? throw new ArgumentNullException(nameof(attribute)); }