Ejemplo n.º 1
0
            public void FindGenericByName(bool useCompiledXaml)
            {
                var layout = new GenericsTests(useCompiledXaml);
                var list   = layout.FindByName <List <Button> > ("myList");

                Assert.NotNull(list);
            }
Ejemplo n.º 2
0
            public void TestXamlPrimitives(bool useCompiledXaml)
            {
                var layout = new GenericsTests(useCompiledXaml);
                var list   = layout.Resources ["stringList"];

                Assert.NotNull(list);
                Assert.That(list, Is.TypeOf <List <String> > ());
            }
Ejemplo n.º 3
0
            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 <List <Button> > ());
                Assert.AreEqual(2, ((List <Button>)list).Count);
            }
Ejemplo n.º 4
0
            public void FindGenericByName(bool useCompiledXaml)
            {
                var layout = new GenericsTests(useCompiledXaml);
                var list   = layout.FindByName <List <Button> > ("myList");

                Assert.That(list, Is.Not.Null);
                Assert.That(list, Is.TypeOf <List <Button> >());

                var nestedGenericList = layout.TestListMember;

                Assert.That(nestedGenericList, Is.Not.Null);
                Assert.That(nestedGenericList, Is.TypeOf <List <KeyValuePair <string, string> > >());

                Assert.That(nestedGenericList.Count, Is.EqualTo(1));
            }
Ejemplo n.º 5
0
            public void TestGenericParsing(bool useCompiledXaml)
            {
                var layout = new GenericsTests(useCompiledXaml);
                var list   = layout.Resources ["list"];

                Assert.NotNull(list);
                Assert.That(list, Is.TypeOf <List <String> > ());

                var dict = layout.Resources ["dict"];

                Assert.NotNull(dict);
                Assert.That(dict, Is.TypeOf <Dictionary <string, string> > ());

                var queue = layout.Resources ["queue"];

                Assert.NotNull(dict);
                Assert.That(queue, Is.TypeOf <Queue <KeyValuePair <string, string> > > ());
            }