public void Test_GetActiveReferences_Multiple_Async() { TestGoal goal = new TestGoal(); goal.ID = Guid.NewGuid(); TestGoal goal2 = new TestGoal(); goal2.ID = Guid.NewGuid(); goal.Prerequisites = new TestGoal[] {goal2}; EntityReferenceCollection references = DataAccess.Data.Referencer.GetActiveReferences(goal); Assert.IsNotNull(references, "The reference collection is null."); Assert.AreEqual(1, references.Count, "Incorrect number of references returned."); if (references != null) { Assert.AreEqual(goal.ID, references[0].Entity1ID, "The entity 1 ID wasn't set correctly."); Assert.AreEqual(goal2.ID, references[0].Entity2ID, "The entity 2 ID wasn't set correctly."); Assert.AreEqual("TestGoal", references[0].Type1Name, "The type name 1 wasn't set correctly."); Assert.AreEqual("TestGoal", references[0].Type2Name, "The type name 2 wasn't set correctly."); Assert.AreEqual("Prerequisites", references[0].Property1Name, "The property 1 name wasn't set correctly."); Assert.AreEqual(String.Empty, references[0].Property2Name, "The property 2 name wasn't set correctly."); } }
public void Test_GetMirrorPropertyName_Multiple_Implicit_Async_SameEntity() { TestGoal goal = new TestGoal(); goal.ID = Guid.NewGuid(); string mirrorPropertyName = EntitiesUtilities.GetMirrorPropertyName(goal, goal.GetType().GetProperty("Prerequisites")); Assert.AreEqual(String.Empty, mirrorPropertyName, "The mirror property name wasn't determined correctly."); }