return new MasterDetailPage
{
AutomationId = DefaultMainPageId,
- Master = new ContentPage { Title = "Master", BackgroundColor = Color.Red },
+ Master = new ContentPage { Title = "Master", Content = new View { BackgroundColor = Color.Red } },
Detail = CoreGallery.GetMainPage()
};
}
Assert.AreEqual (typeof (MockRenderer), registrar.GetHandlerType (typeof (View)));
}
+
+ [Test]
+ public void TestGetRendererNullViewRenderer()
+ {
+ var registrar = new Internals.Registrar<MockRenderer>();
+
+ //let's say that we are now registering the view of a viewcell
+ registrar.Register(typeof(View), typeof(MockRenderer));
+ //later we had a view that was registered with null because there's
+ //no default renderer for View
+ registrar.Register(typeof(View), null);
+
+ var renderer = registrar.GetHandler(typeof(View));
+
+ Assert.That(renderer, Is.InstanceOf<MockRenderer>());
+ }
+
}
}
public void Register(Type tview, Type trender)
{
+ //avoid caching null renderers
+ if (trender == null)
+ return;
_handlers[tview] = trender;
}
foreach (Attribute attribute in effectAttributes)
{
var effect = (ExportEffectAttribute)attribute;
- Effects [resolutionName + "." + effect.Id] = effect.Type;
+ Effects[resolutionName + "." + effect.Id] = effect.Type;
}
}
}