diff options
author | Stephane Delcroix <stephane@delcroix.org> | 2017-02-02 10:57:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-02 10:57:50 +0100 |
commit | fa0882114d31387acaa8d6f43b638a0bf1efa871 (patch) | |
tree | da73c08286f19c2aae8cabbbfbf630e47ad9a7f5 /Xamarin.Forms.Xaml.UnitTests | |
parent | 72699e34b2f4b3e8a939eebe03240ca7511b50e7 (diff) | |
download | xamarin-forms-fa0882114d31387acaa8d6f43b638a0bf1efa871.tar.gz xamarin-forms-fa0882114d31387acaa8d6f43b638a0bf1efa871.tar.bz2 xamarin-forms-fa0882114d31387acaa8d6f43b638a0bf1efa871.zip |
[XamlC] Produce correct mdb files (#699)
* [XamlC] change MockCompile (internal) API
* [XamlC] fix debugging in unit test project
* f
* [XamlC] update cecil to 0.10.0-beta1-v2
* beta2
* avoid method duplication
* [XamlC] force loading MdbReader and Writer
* [XamlC] force use the writer in the other task too
* [XamlC] fix test and test code generator
* try building this
* [XamlC] Ensure InitializeComponent is correctly routed
* fix
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests')
14 files changed, 206 insertions, 25 deletions
diff --git a/Xamarin.Forms.Xaml.UnitTests/DefaultCtorRouting.xaml b/Xamarin.Forms.Xaml.UnitTests/DefaultCtorRouting.xaml new file mode 100644 index 00000000..d008ed5e --- /dev/null +++ b/Xamarin.Forms.Xaml.UnitTests/DefaultCtorRouting.xaml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" + x:Class="Xamarin.Forms.Xaml.UnitTests.DefaultCtorRouting" + IsCompiled="IsCompiled?"> +</ContentPage>
\ No newline at end of file diff --git a/Xamarin.Forms.Xaml.UnitTests/DefaultCtorRouting.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/DefaultCtorRouting.xaml.cs new file mode 100644 index 00000000..250eed72 --- /dev/null +++ b/Xamarin.Forms.Xaml.UnitTests/DefaultCtorRouting.xaml.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using Mono.Cecil; +using Mono.Cecil.Cil; +using NUnit.Framework; +using Xamarin.Forms.Core.UnitTests; +using Xamarin.Forms.Xaml; + +namespace Xamarin.Forms.Xaml.UnitTests +{ + [XamlCompilation(XamlCompilationOptions.Skip)] + public partial class DefaultCtorRouting : ContentPage + { + [TypeConverter(typeof(IsCompiledTypeConverter))] + public bool IsCompiled { get; set; } + + public DefaultCtorRouting() + { + InitializeComponent(); + } + + [TestFixture] + class Tests + { + [SetUp] + public void Setup() + { + Device.PlatformServices = new MockPlatformServices(); + } + + [TearDown] + public void TearDown() + { + Device.PlatformServices = null; + } + + [Test] + public void ShouldntBeCompiled() + { + var p = new DefaultCtorRouting(); + Assert.False(p.IsCompiled); + } + } + } + + [ProvideCompiled("Xamarin.Forms.Core.XamlC.IsCompiledTypeConverter")] + class IsCompiledTypeConverter : TypeConverter, ICompiledTypeConverter + { + public override object ConvertFromInvariantString(string value) + { + if (value != "IsCompiled?") + throw new Exception(); + return false; + } + + public IEnumerable<Instruction> ConvertFromString(string value, ModuleDefinition module, BaseNode node) + { + if (value != "IsCompiled?") + throw new Exception(); + yield return Instruction.Create(OpCodes.Ldc_I4_1); + } + } +}
\ No newline at end of file diff --git a/Xamarin.Forms.Xaml.UnitTests/DefaultCtorRouting2.xaml b/Xamarin.Forms.Xaml.UnitTests/DefaultCtorRouting2.xaml new file mode 100644 index 00000000..f2ccba8b --- /dev/null +++ b/Xamarin.Forms.Xaml.UnitTests/DefaultCtorRouting2.xaml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" + xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" + x:Class="Xamarin.Forms.Xaml.UnitTests.DefaultCtorRouting2" + IsCompiled="IsCompiled?"> +</ContentPage>
\ No newline at end of file diff --git a/Xamarin.Forms.Xaml.UnitTests/DefaultCtorRouting2.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/DefaultCtorRouting2.xaml.cs new file mode 100644 index 00000000..05254770 --- /dev/null +++ b/Xamarin.Forms.Xaml.UnitTests/DefaultCtorRouting2.xaml.cs @@ -0,0 +1,57 @@ +using NUnit.Framework; +using Xamarin.Forms.Core.UnitTests; + +namespace Xamarin.Forms.Xaml.UnitTests +{ + public partial class DefaultCtorRouting2 : ContentPage + { + [TypeConverter(typeof(IsCompiledTypeConverter))] + public bool IsCompiled { get; set; } + + public DefaultCtorRouting2() + { + InitializeComponent(); + } + + [TestFixture] + class Tests + { + [SetUp] + public void Setup() + { + Device.PlatformServices = new MockPlatformServices(); + } + + [TearDown] + public void TearDown() + { + Device.PlatformServices = null; + Internals.XamlLoader.XamlFileProvider = null; + } + + [Test] + public void ShouldBeCompiled() + { + var p = new DefaultCtorRouting2(); + Assert.True(p.IsCompiled); + } + + [Test] + public void ShouldntBeCompiled() + { + Internals.XamlLoader.XamlFileProvider = (t) => { + if (t == typeof(DefaultCtorRouting2)) + return @"<?xml version=""1.0"" encoding=""UTF-8""?> +<ContentPage xmlns=""http://xamarin.com/schemas/2014/forms"" + xmlns:x=""http://schemas.microsoft.com/winfx/2009/xaml"" + x:Class=""Xamarin.Forms.Xaml.UnitTests.DefaultCtorRouting2"" + IsCompiled=""IsCompiled?""> +</ContentPage>"; + return null; + }; + var p = new DefaultCtorRouting2(); + Assert.False(p.IsCompiled); + } + } + } +}
\ No newline at end of file diff --git a/Xamarin.Forms.Xaml.UnitTests/FactoryMethodMissingCtor.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/FactoryMethodMissingCtor.xaml.cs index 6771edf6..919d654b 100644 --- a/Xamarin.Forms.Xaml.UnitTests/FactoryMethodMissingCtor.xaml.cs +++ b/Xamarin.Forms.Xaml.UnitTests/FactoryMethodMissingCtor.xaml.cs @@ -12,6 +12,11 @@ namespace Xamarin.Forms.Xaml.UnitTests InitializeComponent(); } + public FactoryMethodMissingCtor(bool useCompiledXaml) + { + //this stub will be replaced at compile time + } + [TestFixture] public class Tests { @@ -28,7 +33,7 @@ namespace Xamarin.Forms.Xaml.UnitTests if (useCompiledXaml) Assert.Throws(new XamlParseExceptionConstraint(7, 4), () => MockCompiler.Compile(typeof(FactoryMethodMissingCtor))); else - Assert.Throws<MissingMethodException>(() => new FactoryMethodMissingCtor()); + Assert.Throws<MissingMethodException>(() => new FactoryMethodMissingCtor(useCompiledXaml)); } } } diff --git a/Xamarin.Forms.Xaml.UnitTests/FactoryMethodMissingMethod.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/FactoryMethodMissingMethod.xaml.cs index ecc40487..962070f3 100644 --- a/Xamarin.Forms.Xaml.UnitTests/FactoryMethodMissingMethod.xaml.cs +++ b/Xamarin.Forms.Xaml.UnitTests/FactoryMethodMissingMethod.xaml.cs @@ -12,6 +12,11 @@ namespace Xamarin.Forms.Xaml.UnitTests InitializeComponent(); } + public FactoryMethodMissingMethod(bool useCompiledXaml) + { + //this stub will be replaced at compile time + } + [TestFixture] public class Tests { @@ -28,7 +33,7 @@ namespace Xamarin.Forms.Xaml.UnitTests if (useCompiledXaml) Assert.Throws(new XamlParseExceptionConstraint(8, 4), () => MockCompiler.Compile(typeof(FactoryMethodMissingMethod))); else - Assert.Throws<MissingMemberException>(() => new FactoryMethodMissingMethod()); + Assert.Throws<MissingMemberException>(() => new FactoryMethodMissingMethod(useCompiledXaml)); } } } diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43450.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43450.xaml.cs index b3346b37..6c0c42f5 100644 --- a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43450.xaml.cs +++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz43450.xaml.cs @@ -1,4 +1,5 @@ using NUnit.Framework; +using Xamarin.Forms.Core.UnitTests; namespace Xamarin.Forms.Xaml.UnitTests { @@ -18,6 +19,18 @@ namespace Xamarin.Forms.Xaml.UnitTests [TestFixture] class Tests { + [SetUp] + public void Setup() + { + Device.PlatformServices = new MockPlatformServices(); + } + + [TearDown] + public void TearDown() + { + Device.PlatformServices = null; + } + [TestCase(true)] [TestCase(false)] public void DoesNotAllowGridRowDefinition(bool useCompiledXaml) diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Unreported008.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Unreported008.xaml.cs index d5f84d41..6e5dfc5e 100644 --- a/Xamarin.Forms.Xaml.UnitTests/Issues/Unreported008.xaml.cs +++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Unreported008.xaml.cs @@ -4,7 +4,6 @@ using Xamarin.Forms.Core.UnitTests; namespace Xamarin.Forms.Xaml.UnitTests { - [XamlCompilation(XamlCompilationOptions.Skip)] public partial class Unreported008 : ContentPage { public Unreported008() diff --git a/Xamarin.Forms.Xaml.UnitTests/MockCompiler.cs b/Xamarin.Forms.Xaml.UnitTests/MockCompiler.cs index 6e63f6a4..79f840c5 100644 --- a/Xamarin.Forms.Xaml.UnitTests/MockCompiler.cs +++ b/Xamarin.Forms.Xaml.UnitTests/MockCompiler.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using Xamarin.Forms.Build.Tasks; +using Mono.Cecil; namespace Xamarin.Forms.Xaml.UnitTests { @@ -10,6 +11,13 @@ namespace Xamarin.Forms.Xaml.UnitTests { public static void Compile(Type type) { + MethodDefinition _; + Compile(type, out _); + } + + public static void Compile(Type type, out MethodDefinition methdoDefinition) + { + methdoDefinition = null; var assembly = type.Assembly.Location; var refs = from an in type.Assembly.GetReferencedAssemblies() let a = System.Reflection.Assembly.Load(an) @@ -20,12 +28,19 @@ namespace Xamarin.Forms.Xaml.UnitTests ReferencePath = string.Join(";", refs), KeepXamlResources = true, OptimizeIL = true, + DebugSymbols = false, + ReadOnly = true, Type = type.FullName }; - var exceptions = new List<Exception>(); - if (!xamlc.Execute(exceptions) && exceptions.Any()) - throw exceptions [0]; + IList<Exception> exceptions; + if (xamlc.Execute(out exceptions) || exceptions == null || !exceptions.Any()) { + methdoDefinition = xamlc.InitCompForType; + return; + } + if (exceptions.Count > 1) + throw new AggregateException(exceptions); + throw exceptions[0]; } } }
\ No newline at end of file diff --git a/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj b/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj index 5649861b..e6c63d7a 100644 --- a/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj +++ b/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj @@ -57,16 +57,16 @@ <Reference Include="Microsoft.Build.Framework" /> <Reference Include="Microsoft.Build.Tasks.v4.0" /> <Reference Include="Mono.Cecil"> - <HintPath>..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.dll</HintPath> + <HintPath>..\packages\Mono.Cecil.0.10.0-beta2\lib\net40\Mono.Cecil.dll</HintPath> </Reference> <Reference Include="Mono.Cecil.Mdb"> - <HintPath>..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Mdb.dll</HintPath> + <HintPath>..\packages\Mono.Cecil.0.10.0-beta2\lib\net40\Mono.Cecil.Mdb.dll</HintPath> </Reference> <Reference Include="Mono.Cecil.Pdb"> - <HintPath>..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Pdb.dll</HintPath> + <HintPath>..\packages\Mono.Cecil.0.10.0-beta2\lib\net40\Mono.Cecil.Pdb.dll</HintPath> </Reference> <Reference Include="Mono.Cecil.Rocks"> - <HintPath>..\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Rocks.dll</HintPath> + <HintPath>..\packages\Mono.Cecil.0.10.0-beta2\lib\net40\Mono.Cecil.Rocks.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> @@ -427,6 +427,12 @@ <Compile Include="Issues\Bz44213.xaml.cs"> <DependentUpon>Bz44213.xaml</DependentUpon> </Compile> + <Compile Include="DefaultCtorRouting.xaml.cs"> + <DependentUpon>DefaultCtorRouting.xaml</DependentUpon> + </Compile> + <Compile Include="DefaultCtorRouting2.xaml.cs"> + <DependentUpon>DefaultCtorRouting2.xaml</DependentUpon> + </Compile> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="..\.nuspec\Xamarin.Forms.Debug.targets" /> @@ -775,6 +781,12 @@ <EmbeddedResource Include="Issues\Bz44213.xaml"> <Generator>MSBuild:UpdateDesignTimeXaml</Generator> </EmbeddedResource> + <EmbeddedResource Include="DefaultCtorRouting.xaml"> + <Generator>MSBuild:UpdateDesignTimeXaml</Generator> + </EmbeddedResource> + <EmbeddedResource Include="DefaultCtorRouting2.xaml"> + <Generator>MSBuild:UpdateDesignTimeXaml</Generator> + </EmbeddedResource> </ItemGroup> <ItemGroup> <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> diff --git a/Xamarin.Forms.Xaml.UnitTests/XamlC/FieldReferenceExtensionsTests.cs b/Xamarin.Forms.Xaml.UnitTests/XamlC/FieldReferenceExtensionsTests.cs index 79144f98..6abf1e27 100644 --- a/Xamarin.Forms.Xaml.UnitTests/XamlC/FieldReferenceExtensionsTests.cs +++ b/Xamarin.Forms.Xaml.UnitTests/XamlC/FieldReferenceExtensionsTests.cs @@ -37,7 +37,7 @@ namespace Xamarin.Forms.Xaml.XamlcUnitTests [Test] public void ResolveGenericsOnNonGenericDoesNotThrow () { - var type = module.Import (typeof (NonGenericClass)); + var type = module.ImportReference (typeof (NonGenericClass)); TypeReference declaringTypeReference; FieldDefinition field = type.GetField (fd => fd.Name == "Field", out declaringTypeReference); Assert.DoesNotThrow (() => field.ResolveGenericParameters (declaringTypeReference)); @@ -46,7 +46,7 @@ namespace Xamarin.Forms.Xaml.XamlcUnitTests [Test] public void NonGenericFieldOnGenericType () { - var type = module.Import (typeof (Inheritor)); + var type = module.ImportReference (typeof (Inheritor)); TypeReference declaringTypeReference; FieldDefinition field = type.GetField (fd => fd.Name == "NonGenericField", out declaringTypeReference); Assert.AreEqual ("NonGenericField", field.Name); @@ -61,7 +61,7 @@ namespace Xamarin.Forms.Xaml.XamlcUnitTests [Test] public void GenericFieldOnGenericType () { - var type = module.Import (typeof (Inheritor)); + var type = module.ImportReference (typeof (Inheritor)); TypeReference declaringTypeReference; FieldDefinition field1 = type.GetField (fd => fd.Name == "GenericField1", out declaringTypeReference); diff --git a/Xamarin.Forms.Xaml.UnitTests/XamlC/MethodReferenceExtensionsTests.cs b/Xamarin.Forms.Xaml.UnitTests/XamlC/MethodReferenceExtensionsTests.cs index ab7925ac..3bc9da2c 100644 --- a/Xamarin.Forms.Xaml.UnitTests/XamlC/MethodReferenceExtensionsTests.cs +++ b/Xamarin.Forms.Xaml.UnitTests/XamlC/MethodReferenceExtensionsTests.cs @@ -24,13 +24,13 @@ namespace Xamarin.Forms.Xaml.XamlcUnitTests [Test] public void ResolveRowDefAdder () { - var propertyType = module.Import(typeof (RowDefinitionCollection)); + var propertyType = module.ImportReference(typeof (RowDefinitionCollection)); var adderT = propertyType.GetMethods ((md, tr) => md.Name == "Add", module).Single (); var adder = adderT.Item1; var ptype = adderT.Item2; Assert.AreEqual ("System.Void Xamarin.Forms.DefinitionCollection`1::Add(T)", adder.FullName); Assert.AreEqual ("Xamarin.Forms.DefinitionCollection`1<Xamarin.Forms.RowDefinition>", ptype.FullName); - var adderRef = module.Import (adder); + var adderRef = module.ImportReference (adder); Assert.AreEqual ("System.Void Xamarin.Forms.DefinitionCollection`1::Add(T)", adderRef.FullName); adderRef = adderRef.ResolveGenericParameters (ptype, module); Assert.AreEqual ("System.Void Xamarin.Forms.DefinitionCollection`1<Xamarin.Forms.RowDefinition>::Add(T)", adderRef.FullName); @@ -40,16 +40,16 @@ namespace Xamarin.Forms.Xaml.XamlcUnitTests public void GenericGetter () { TypeReference declaringTypeReference; - var type = module.Import (typeof (StackLayout)); + var type = module.ImportReference (typeof (StackLayout)); var property = type.GetProperty (pd => pd.Name == "Children", out declaringTypeReference); Assert.AreEqual ("System.Collections.Generic.IList`1<T> Xamarin.Forms.Layout`1::Children()", property.FullName); Assert.AreEqual ("Xamarin.Forms.Layout`1<Xamarin.Forms.View>", declaringTypeReference.FullName); var propertyGetter = property.GetMethod; Assert.AreEqual ("System.Collections.Generic.IList`1<T> Xamarin.Forms.Layout`1::get_Children()", propertyGetter.FullName); - var propertyGetterRef = module.Import (propertyGetter); + var propertyGetterRef = module.ImportReference (propertyGetter); Assert.AreEqual ("System.Collections.Generic.IList`1<T> Xamarin.Forms.Layout`1::get_Children()", propertyGetterRef.FullName); - propertyGetterRef = module.Import (propertyGetterRef.ResolveGenericParameters (declaringTypeReference, module)); + propertyGetterRef = module.ImportReference (propertyGetterRef.ResolveGenericParameters (declaringTypeReference, module)); Assert.AreEqual ("System.Collections.Generic.IList`1<T> Xamarin.Forms.Layout`1<Xamarin.Forms.View>::get_Children()", propertyGetterRef.FullName); var returnType = propertyGetterRef.ReturnType.ResolveGenericParameters (declaringTypeReference); Assert.AreEqual ("System.Collections.Generic.IList`1<Xamarin.Forms.View>", returnType.FullName); @@ -59,16 +59,16 @@ namespace Xamarin.Forms.Xaml.XamlcUnitTests public void GetterWithGenericReturnType () { TypeReference declaringTypeReference; - var type = module.Import (typeof (Style)); + var type = module.ImportReference (typeof (Style)); var property = type.GetProperty (pd => pd.Name == "Setters", out declaringTypeReference); Assert.AreEqual ("System.Collections.Generic.IList`1<Xamarin.Forms.Setter> Xamarin.Forms.Style::Setters()", property.FullName); Assert.AreEqual ("Xamarin.Forms.Style", declaringTypeReference.FullName); var propertyGetter = property.GetMethod; Assert.AreEqual ("System.Collections.Generic.IList`1<Xamarin.Forms.Setter> Xamarin.Forms.Style::get_Setters()", propertyGetter.FullName); - var propertyGetterRef = module.Import (propertyGetter); + var propertyGetterRef = module.ImportReference (propertyGetter); Assert.AreEqual ("System.Collections.Generic.IList`1<Xamarin.Forms.Setter> Xamarin.Forms.Style::get_Setters()", propertyGetterRef.FullName); - propertyGetterRef = module.Import (propertyGetterRef.ResolveGenericParameters (declaringTypeReference, module)); + propertyGetterRef = module.ImportReference (propertyGetterRef.ResolveGenericParameters (declaringTypeReference, module)); Assert.AreEqual ("System.Collections.Generic.IList`1<Xamarin.Forms.Setter> Xamarin.Forms.Style::get_Setters()", propertyGetterRef.FullName); var returnType = propertyGetterRef.ReturnType.ResolveGenericParameters (declaringTypeReference); Assert.AreEqual ("System.Collections.Generic.IList`1<Xamarin.Forms.Setter>", returnType.FullName); @@ -77,13 +77,13 @@ namespace Xamarin.Forms.Xaml.XamlcUnitTests [Test] public void ResolveChildren () { - var propertyType = module.Import (typeof (IList<View>)); + var propertyType = module.ImportReference (typeof (IList<View>)); var adderT = propertyType.GetMethods (md => md.Name == "Add" && md.Parameters.Count == 1, module).Single (); var adder = adderT.Item1; var ptype = adderT.Item2; Assert.AreEqual ("System.Void System.Collections.Generic.ICollection`1::Add(T)", adder.FullName); Assert.AreEqual ("System.Collections.Generic.ICollection`1<Xamarin.Forms.View>", ptype.FullName); - var adderRef = module.Import (adder); + var adderRef = module.ImportReference (adder); Assert.AreEqual ("System.Void System.Collections.Generic.ICollection`1::Add(T)", adderRef.FullName); adderRef = adderRef.ResolveGenericParameters (ptype, module); Assert.AreEqual ("System.Void System.Collections.Generic.ICollection`1<Xamarin.Forms.View>::Add(T)", adderRef.FullName); diff --git a/Xamarin.Forms.Xaml.UnitTests/XamlC/TypeReferenceExtensionsTests.cs b/Xamarin.Forms.Xaml.UnitTests/XamlC/TypeReferenceExtensionsTests.cs index 3b6f293f..9aa03b9e 100644 --- a/Xamarin.Forms.Xaml.UnitTests/XamlC/TypeReferenceExtensionsTests.cs +++ b/Xamarin.Forms.Xaml.UnitTests/XamlC/TypeReferenceExtensionsTests.cs @@ -97,7 +97,7 @@ namespace Xamarin.Forms.Xaml.XamlcUnitTests [TestCase(typeof(Bar<string>), typeof(Foo<string>), ExpectedResult = true)] public bool TestInheritsFromOrImplements(Type typeRef, Type baseClass) { - return TypeReferenceExtensions.InheritsFromOrImplements(module.Import(typeRef), module.Import(baseClass)); + return TypeReferenceExtensions.InheritsFromOrImplements(module.ImportReference(typeRef), module.ImportReference(baseClass)); } [Test] diff --git a/Xamarin.Forms.Xaml.UnitTests/packages.config b/Xamarin.Forms.Xaml.UnitTests/packages.config index 83b8c2ff..e1ee7871 100644 --- a/Xamarin.Forms.Xaml.UnitTests/packages.config +++ b/Xamarin.Forms.Xaml.UnitTests/packages.config @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Mono.Cecil" version="0.9.6.4" targetFramework="net451" /> + <package id="Mono.Cecil" version="0.10.0-beta2" targetFramework="net451" /> <package id="NUnit" version="2.6.4" targetFramework="net451" /> </packages>
\ No newline at end of file |