public void Attribute_WhenCalledAfterInstantiationAndPropertyDoesNotHaveAtrribute_ReturnsEmptyMaybe() { // ARRANGE Type testType = typeof(TestObject1); // ACT Maybe<SchemaAttribute> actual = new TypeSchemaAttributeFinder(testType).GetResult(); // ASSERT Assert.IsNull(actual.FirstOrDefault()); }
public void HasAttribute_WhenCalledAfterInstantiationAndPropertyDoesHaveAtrribute_ReturnsTrue() { // ARRANGE Type testType = typeof(TestObject2); // ACT bool actual = new TypeSchemaAttributeFinder(testType).HasFoundAttribute; // ASSERT Assert.IsTrue(actual); }
public void Attribute_WhenCalledAfterInstantiationAndPropertyDoesHaveAtrribute_ReturnsMaybePopulatedWithInstanceOfAttribute() { // ARRANGE Type testType = typeof(TestObject2); // ACT Maybe<SchemaAttribute> actual = new TypeSchemaAttributeFinder(testType).GetResult(); // ASSERT Assert.IsNotNull(actual); Assert.IsInstanceOfType(actual.FirstOrDefault(), typeof(SchemaAttribute)); Assert.AreEqual("log", actual.Single().Value); }