public IEnumerator HighlightWithColor() { foreach (Type highlighterImplementation in ReflectionUtils.GetConcreteImplementationsOf <IHighlighter>()) { // Given a GameObject with at least one Renderer GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube); IHighlighter highlighter = cube.AddComponent(highlighterImplementation) as IHighlighter; Material testMaterial = CreateHighlightMaterial(); Color testColor = Color.green; testMaterial.color = testColor; Assert.That(highlighter != null); Assert.IsFalse(highlighter.IsHighlighting); // When StartHighlighting highlighter.StartHighlighting(testMaterial); yield return(null); // Then the object is highlighted with provided color Material highlightMaterial = highlighter.GetHighlightMaterial(); Assert.IsTrue(highlighter.IsHighlighting); Assert.That(highlightMaterial.color == testColor); } }