public void GetResult_WhenCalledAfterInstantiationAndPropertyDoesNotHaveAtrribute_ReturnsEmptyMaybe() { // ARRANGE Type testType = typeof(TestObject); PropertyInfo property = testType.GetProperty("Procedure1"); // ACT Maybe<SchemaAttribute> actual = new PropertySchemaAttributeFinder(property).GetResult(); // ASSERT Assert.IsNull(actual.FirstOrDefault()); }
public void HasAttribute_WhenCalledAfterInstantiationAndPropertyDoesHaveAtrribute_ReturnsTrue() { // ARRANGE Type testType = typeof(TestObject); PropertyInfo property = testType.GetProperty("Procedure2"); // ACT bool actual = new PropertySchemaAttributeFinder(property).HasFoundAttribute; // ASSERT Assert.IsTrue(actual); }
public void GetResult_WhenCalledAfterInstantiationAndPropertyDoesHaveAtrribute_ReturnsMaybePopulatedWithInstanceOfAttribute() { // ARRANGE Type testType = typeof(TestObject); PropertyInfo property = testType.GetProperty("Procedure2"); // ACT Maybe<SchemaAttribute> actual = new PropertySchemaAttributeFinder(property).GetResult(); // ASSERT Assert.IsNotNull(actual); Assert.IsInstanceOfType(actual.FirstOrDefault(), typeof(SchemaAttribute)); Assert.AreEqual("log", actual.Single().Value); }