using System; using System.Collections.Generic; using Xamarin.Forms; using NUnit.Framework; namespace Xamarin.Forms.Xaml.UnitTests { public partial class GenericsTests : ContentPage { public GenericsTests () { InitializeComponent (); } public GenericsTests (bool useCompiledXaml) { //this stub will be replaced at compile time } [TestFixture] public class Tests { [Test] public void NoGenericsOnXaml2006 () { var xaml = @" "; Assert.Throws (new XamlParseExceptionConstraint (8, 9), () => new ContentPage ().LoadFromXaml (xaml)); } [TestCase (false)] [TestCase (true)] public void GenericSupportOnXaml2009 (bool useCompiledXaml) { var layout = new GenericsTests (useCompiledXaml); Assert.True (layout.Resources.ContainsKey ("genericButtonList")); var list = layout.Resources ["genericButtonList"]; Assert.That (list, Is.TypeOf> ()); Assert.AreEqual (2, ((List