diff --git a/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj b/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj index 23825bac7..90984f7a4 100644 --- a/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj +++ b/Xamarin.Forms.ControlGallery.iOS/Xamarin.Forms.ControlGallery.iOS.csproj @@ -349,7 +349,7 @@ - + diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla35736.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla35736.cs index 190286dca..1581e8c5b 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla35736.cs +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla35736.cs @@ -45,7 +45,7 @@ namespace Xamarin.Forms.Controls.Issues #if UITEST && __IOS__ [Test] [Category(UITestCategories.ManualReview)] - [Ignore("Fails sometimes")] + [Ignore] public void Bugzilla35736Test() { RunningApp.WaitForElement(q => q.Marked("Bugzilla35736Editor")); diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TestPages/ScreenshotConditionalApp.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TestPages/ScreenshotConditionalApp.cs index b3344fb03..6e458d2b8 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TestPages/ScreenshotConditionalApp.cs +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TestPages/ScreenshotConditionalApp.cs @@ -236,7 +236,9 @@ namespace Xamarin.Forms.Controls public void SwipeRight() { - SwipeLeftToRight(); +#pragma warning disable 618 + _app.SwipeRight(); +#pragma warning restore 618 } public void SwipeLeftToRight(double swipePercentage = 0.67, int swipeSpeed = 500, bool withInertia = true) @@ -251,7 +253,9 @@ namespace Xamarin.Forms.Controls public void SwipeLeft() { - SwipeRightToLeft(); +#pragma warning disable 618 + _app.SwipeLeft(); +#pragma warning restore 618 } public void SwipeRightToLeft(double swipePercentage = 0.67, int swipeSpeed = 500, bool withInertia = true) diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TestPages/TestPages.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TestPages/TestPages.cs index df025539e..e151c7d8f 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TestPages/TestPages.cs +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/TestPages/TestPages.cs @@ -696,7 +696,7 @@ namespace Xamarin.Forms.Controls.Issues [SetUpFixture] public class IssuesSetup { - [OneTimeSetUp] + [SetUp] public void RunBeforeAnyTests() { AppSetup.RunningApp = AppSetup.Setup(null); diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems index da5753ec5..d1d5a7455 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems @@ -1256,7 +1256,7 @@ Designer - MSBuild:UpdateDesignTimeXaml + MSBuild:Compile Designer diff --git a/Xamarin.Forms.Core.Android.UITests/Xamarin.Forms.Core.Android.UITests.csproj b/Xamarin.Forms.Core.Android.UITests/Xamarin.Forms.Core.Android.UITests.csproj index 7c4e0f559..9eab00b88 100644 --- a/Xamarin.Forms.Core.Android.UITests/Xamarin.Forms.Core.Android.UITests.csproj +++ b/Xamarin.Forms.Core.Android.UITests/Xamarin.Forms.Core.Android.UITests.csproj @@ -46,12 +46,12 @@ - - - - - 3.13.0 + + + 2.1.1 + + @@ -87,7 +87,7 @@ - <_XamarinUITestFiles Include="$(NuGetPackageRoot)Xamarin.UITest\%(Version)\**" Condition="@(PackageReference -> '%(Identity)') == 'Xamarin.UITest'" InProject="False" /> + <_XamarinUITestFiles Include="$(NuGetPackageRoot)Xamarin.UITest\%(Version)\**" Condition="@(PackageReference -> '%(Identity)') == 'Xamarin.UITest'" InProject="False" /> diff --git a/Xamarin.Forms.Core.UITests.Shared/BaseTestFixture.cs b/Xamarin.Forms.Core.UITests.Shared/BaseTestFixture.cs index e7b77c1fe..6abf117f4 100644 --- a/Xamarin.Forms.Core.UITests.Shared/BaseTestFixture.cs +++ b/Xamarin.Forms.Core.UITests.Shared/BaseTestFixture.cs @@ -17,7 +17,7 @@ namespace Xamarin.Forms.Core.UITests public static AppRect ScreenBounds { get; set; } - [OneTimeTearDown] + [TestFixtureTearDown] protected virtual void FixtureTeardown() { } @@ -45,7 +45,7 @@ namespace Xamarin.Forms.Core.UITests [SetUp] protected virtual void TestSetup() { - //EnsureMemory(); + EnsureMemory(); } [TearDown] @@ -55,7 +55,9 @@ namespace Xamarin.Forms.Core.UITests protected abstract void NavigateToGallery(); - [OneTimeSetUp] +#pragma warning disable 618 + [TestFixtureSetUp] +#pragma warning restore 618 protected virtual void FixtureSetup() { ResetApp(); @@ -109,6 +111,7 @@ namespace Xamarin.Forms.Core.UITests } } } + #if UITEST namespace Xamarin.Forms.Core.UITests @@ -118,7 +121,7 @@ namespace Xamarin.Forms.Core.UITests [SetUpFixture] public class CoreUITestsSetup { - [OneTimeSetUp] + [SetUp] public void RunBeforeAnyTests() { LaunchApp(); @@ -135,4 +138,4 @@ namespace Xamarin.Forms.Core.UITests } } -#endif +#endif \ No newline at end of file diff --git a/Xamarin.Forms.Core.UnitTests/AnimationTests.cs b/Xamarin.Forms.Core.UnitTests/AnimationTests.cs index 121a3c841..5b110bebf 100644 --- a/Xamarin.Forms.Core.UnitTests/AnimationTests.cs +++ b/Xamarin.Forms.Core.UnitTests/AnimationTests.cs @@ -8,7 +8,7 @@ namespace Xamarin.Forms.Core.UnitTests { [Test] //https://bugzilla.xamarin.com/show_bug.cgi?id=51424 - public async Task AnimationRepeats() + public async void AnimationRepeats() { var box = new BoxView(); Assume.That(box.Rotation, Is.EqualTo(0d)); diff --git a/Xamarin.Forms.Core.UnitTests/BindingUnitTests.cs b/Xamarin.Forms.Core.UnitTests/BindingUnitTests.cs index 548034fd2..c536c49a9 100644 --- a/Xamarin.Forms.Core.UnitTests/BindingUnitTests.cs +++ b/Xamarin.Forms.Core.UnitTests/BindingUnitTests.cs @@ -1588,7 +1588,7 @@ namespace Xamarin.Forms.Core.UnitTests Assert.That (() => bindable.SetBinding (MockBindable.TextProperty, new Binding ("Text2")), Throws.Nothing); Assert.That (bindable.Text, Is.EqualTo (MockBindable.TextProperty.DefaultValue)); Assert.That (log.Messages.Count, Is.EqualTo (1), "An error was not logged"); - Assert.That (log.Messages[0], Does.Contain(String.Format (BindingExpression.PropertyNotFoundErrorMessage, + Assert.That (log.Messages[0], Is.StringContaining (String.Format (BindingExpression.PropertyNotFoundErrorMessage, "Text2", "Xamarin.Forms.Core.UnitTests.BindingUnitTests+DifferentViewModel", "Xamarin.Forms.Core.UnitTests.MockBindable", @@ -1607,7 +1607,7 @@ namespace Xamarin.Forms.Core.UnitTests Assert.That (bindable.Text, Is.EqualTo ("Foo")); Assert.That (log.Messages.Count, Is.Not.GreaterThan (1), "Too many errors were logged"); - Assert.That (log.Messages[0], Does.Contain(String.Format (BindingExpression.PropertyNotFoundErrorMessage, + Assert.That (log.Messages[0], Is.StringContaining (String.Format (BindingExpression.PropertyNotFoundErrorMessage, "Text", "Xamarin.Forms.Core.UnitTests.BindingUnitTests+EmptyViewModel", "Xamarin.Forms.Core.UnitTests.MockBindable", @@ -1621,7 +1621,7 @@ namespace Xamarin.Forms.Core.UnitTests Assert.That (() => bindable.SetBinding (MockBindable.TextProperty, new Binding ("Text")), Throws.Nothing); Assert.That (log.Messages.Count, Is.EqualTo (1), "An error was not logged"); - Assert.That (log.Messages[0], Does.Contain(String.Format (BindingExpression.PropertyNotFoundErrorMessage, + Assert.That (log.Messages[0], Is.StringContaining (String.Format (BindingExpression.PropertyNotFoundErrorMessage, "Text", "Xamarin.Forms.Core.UnitTests.BindingUnitTests+DifferentViewModel", "Xamarin.Forms.Core.UnitTests.MockBindable", @@ -1637,7 +1637,7 @@ namespace Xamarin.Forms.Core.UnitTests Assert.That (() => bindable.SetBinding (MockBindable.TextProperty, new Binding ("PrivateSetter")), Throws.Nothing); Assert.That (log.Messages.Count, Is.EqualTo (1), "An error was not logged"); - Assert.That (log.Messages[0], Does.Contain(String.Format (BindingExpression.PropertyNotFoundErrorMessage, + Assert.That (log.Messages[0], Is.StringContaining (String.Format (BindingExpression.PropertyNotFoundErrorMessage, "PrivateSetter", "Xamarin.Forms.Core.UnitTests.BindingUnitTests+DifferentViewModel", "Xamarin.Forms.Core.UnitTests.MockBindable", @@ -1646,7 +1646,7 @@ namespace Xamarin.Forms.Core.UnitTests Assert.That (() => bindable.SetValueCore (MockBindable.TextProperty, "foo"), Throws.Nothing); Assert.That (log.Messages.Count, Is.EqualTo (2), "An error was not logged"); - Assert.That (log.Messages[1], Does.Contain(String.Format (BindingExpression.PropertyNotFoundErrorMessage, + Assert.That (log.Messages[1], Is.StringContaining (String.Format (BindingExpression.PropertyNotFoundErrorMessage, "PrivateSetter", "Xamarin.Forms.Core.UnitTests.BindingUnitTests+DifferentViewModel", "Xamarin.Forms.Core.UnitTests.MockBindable", @@ -1660,7 +1660,7 @@ namespace Xamarin.Forms.Core.UnitTests Assert.That (() => bindable.SetBinding (MockBindable.TextProperty, new Binding ("MissingProperty")), Throws.Nothing); Assert.That (log.Messages.Count, Is.EqualTo (1), "An error was not logged"); - Assert.That (log.Messages[0], Does.Contain(String.Format (BindingExpression.PropertyNotFoundErrorMessage, + Assert.That (log.Messages[0], Is.StringContaining (String.Format (BindingExpression.PropertyNotFoundErrorMessage, "MissingProperty", "Xamarin.Forms.Core.UnitTests.MockViewModel", "Xamarin.Forms.Core.UnitTests.MockBindable", @@ -1688,7 +1688,7 @@ namespace Xamarin.Forms.Core.UnitTests Assert.That (() => bindable.SetBinding (MockBindable.TextProperty, new Binding ("Model.MissingProperty")), Throws.Nothing); Assert.That (log.Messages.Count, Is.EqualTo (1), "An error was not logged"); - Assert.That (log.Messages[0], Does.Contain(String.Format (BindingExpression.PropertyNotFoundErrorMessage, + Assert.That (log.Messages[0], Is.StringContaining (String.Format (BindingExpression.PropertyNotFoundErrorMessage, "MissingProperty", "Xamarin.Forms.Core.UnitTests.BindingBaseUnitTests+ComplexMockViewModel", "Xamarin.Forms.Core.UnitTests.MockBindable", diff --git a/Xamarin.Forms.Core.UnitTests/CellTests.cs b/Xamarin.Forms.Core.UnitTests/CellTests.cs index e9857e9d0..0006b4cf6 100644 --- a/Xamarin.Forms.Core.UnitTests/CellTests.cs +++ b/Xamarin.Forms.Core.UnitTests/CellTests.cs @@ -1,6 +1,5 @@ using NUnit.Framework; using System; -using System.Threading.Tasks; namespace Xamarin.Forms.Core.UnitTests { @@ -154,7 +153,7 @@ namespace Xamarin.Forms.Core.UnitTests } [Test] - public async Task ForceUpdateSizeCallsAreRateLimited() + public async void ForceUpdateSizeCallsAreRateLimited() { var lv = new ListView { HasUnevenRows = true }; var cell = new ViewCell { Parent = lv }; @@ -173,7 +172,7 @@ namespace Xamarin.Forms.Core.UnitTests } [Test] - public async Task ForceUpdateSizeWillNotBeCalledIfParentIsNotAListViewWithUnevenRows () + public async void ForceUpdateSizeWillNotBeCalledIfParentIsNotAListViewWithUnevenRows () { var lv = new ListView { HasUnevenRows = false }; var cell = new ViewCell { Parent = lv }; diff --git a/Xamarin.Forms.Core.UnitTests/GeocoderUnitTests.cs b/Xamarin.Forms.Core.UnitTests/GeocoderUnitTests.cs index 9047487f8..414c49deb 100644 --- a/Xamarin.Forms.Core.UnitTests/GeocoderUnitTests.cs +++ b/Xamarin.Forms.Core.UnitTests/GeocoderUnitTests.cs @@ -11,7 +11,7 @@ namespace Xamarin.Forms.Core.UnitTests public class GeocoderUnitTests : BaseTestFixture { [Test] - public async Task AddressesForPosition () + public async void AddressesForPosition () { Geocoder.GetAddressesForPositionFuncAsync = GetAddressesForPositionFuncAsync; var geocoder = new Geocoder (); @@ -26,7 +26,7 @@ namespace Xamarin.Forms.Core.UnitTests } [Test] - public async Task PositionsForAddress () { + public async void PositionsForAddress () { Geocoder.GetPositionsForAddressAsyncFunc = GetPositionsForAddressAsyncFunc ; var geocoder = new Geocoder (); var result = await geocoder.GetPositionsForAddressAsync ("quux"); diff --git a/Xamarin.Forms.Core.UnitTests/MotionTests.cs b/Xamarin.Forms.Core.UnitTests/MotionTests.cs index a5aa8c775..432a2a9dd 100644 --- a/Xamarin.Forms.Core.UnitTests/MotionTests.cs +++ b/Xamarin.Forms.Core.UnitTests/MotionTests.cs @@ -61,14 +61,14 @@ namespace Xamarin.Forms.Core.UnitTests [TestFixture] public class MotionTests : BaseTestFixture { - [OneTimeSetUp] + [TestFixtureSetUp] public void Init () { Device.PlatformServices = new MockPlatformServices (); Ticker.Default = new BlockingTicker (); } - [OneTimeTearDown] + [TestFixtureTearDown] public void End () { Device.PlatformServices = null; @@ -154,14 +154,14 @@ namespace Xamarin.Forms.Core.UnitTests [TestFixture] public class TickerSystemEnabledTests { - [OneTimeSetUp] + [TestFixtureSetUp] public void Init () { Device.PlatformServices = new MockPlatformServices (); Ticker.Default = new AsyncTicker(); } - [OneTimeTearDown] + [TestFixtureTearDown] public void End () { Device.PlatformServices = null; diff --git a/Xamarin.Forms.Core.UnitTests/NavigationUnitTest.cs b/Xamarin.Forms.Core.UnitTests/NavigationUnitTest.cs index f5f6e6326..595db9a11 100644 --- a/Xamarin.Forms.Core.UnitTests/NavigationUnitTest.cs +++ b/Xamarin.Forms.Core.UnitTests/NavigationUnitTest.cs @@ -441,7 +441,7 @@ namespace Xamarin.Forms.Core.UnitTests } [Test] - public async Task HandlesPopToRoot () + public async void HandlesPopToRoot () { var root = new ContentPage { Title = "Root" }; var navPage = new NavigationPage (root); @@ -489,7 +489,7 @@ namespace Xamarin.Forms.Core.UnitTests } [Test] - public async Task NavigatesBackWhenBackButtonPressed () + public async void NavigatesBackWhenBackButtonPressed () { var root = new ContentPage { Title = "Root" }; var navPage = new NavigationPage (root); @@ -503,7 +503,7 @@ namespace Xamarin.Forms.Core.UnitTests } [Test] - public async Task DoesNotNavigatesBackWhenBackButtonPressedIfHandled () + public async void DoesNotNavigatesBackWhenBackButtonPressedIfHandled () { var root = new BackButtonPage { Title = "Root" }; var second = new BackButtonPage () {Handle = true}; @@ -562,7 +562,7 @@ namespace Xamarin.Forms.Core.UnitTests } [Test] - public async Task TestRemovePage() + public async void TestRemovePage() { var root = new ContentPage { Title = "Root" }; var newPage = new ContentPage(); diff --git a/Xamarin.Forms.Core.UnitTests/ResourceDictionaryTests.cs b/Xamarin.Forms.Core.UnitTests/ResourceDictionaryTests.cs index 8ada0aec0..157b43f11 100644 --- a/Xamarin.Forms.Core.UnitTests/ResourceDictionaryTests.cs +++ b/Xamarin.Forms.Core.UnitTests/ResourceDictionaryTests.cs @@ -261,7 +261,7 @@ namespace Xamarin.Forms.Core.UnitTests var rd = new ResourceDictionary(); rd.Add("foo", "bar"); var ex = Assert.Throws(() => { var foo = rd ["test_invalid_key"]; }); - Assert.That(ex.Message, Does.Contain("test_invalid_key")); + Assert.That(ex.Message, Is.StringContaining("test_invalid_key")); } class MyRD : ResourceDictionary diff --git a/Xamarin.Forms.Core.UnitTests/StyleTests.cs b/Xamarin.Forms.Core.UnitTests/StyleTests.cs index 6e9df6d3d..0d6bf942c 100644 --- a/Xamarin.Forms.Core.UnitTests/StyleTests.cs +++ b/Xamarin.Forms.Core.UnitTests/StyleTests.cs @@ -411,7 +411,7 @@ namespace Xamarin.Forms.Core.UnitTests [Test] //https://bugzilla.xamarin.com/show_bug.cgi?id=31207 - public async Task StyleDontHoldStrongReferences () + public async void StyleDontHoldStrongReferences () { var style = new Style (typeof(Label)); var label = new Label (); diff --git a/Xamarin.Forms.Core.UnitTests/TypedBindingUnitTests.cs b/Xamarin.Forms.Core.UnitTests/TypedBindingUnitTests.cs index 5d8378552..0d72bead9 100644 --- a/Xamarin.Forms.Core.UnitTests/TypedBindingUnitTests.cs +++ b/Xamarin.Forms.Core.UnitTests/TypedBindingUnitTests.cs @@ -1490,7 +1490,7 @@ namespace Xamarin.Forms.Core.UnitTests } [Test] - [Ignore("SpeedTestApply")] + [Ignore] public void SpeedTestApply() { @@ -1560,7 +1560,7 @@ namespace Xamarin.Forms.Core.UnitTests } [Test] - [Ignore("SpeedTestSetBC")] + [Ignore] public void SpeedTestSetBC() { var property = BindableProperty.Create("Foo", typeof(string), typeof(MockBindable)); diff --git a/Xamarin.Forms.Core.UnitTests/UriImageSourceTests.cs b/Xamarin.Forms.Core.UnitTests/UriImageSourceTests.cs index d0816955b..39bce9310 100644 --- a/Xamarin.Forms.Core.UnitTests/UriImageSourceTests.cs +++ b/Xamarin.Forms.Core.UnitTests/UriImageSourceTests.cs @@ -48,7 +48,7 @@ namespace Xamarin.Forms.Core.UnitTests } [Test] - [Ignore("LoadImageFromStream")] + [Ignore] public void LoadImageFromStream () { var loader = new UriImageSource { @@ -60,7 +60,7 @@ namespace Xamarin.Forms.Core.UnitTests } [Test] - [Ignore("SecondCallLoadFromCache")] + [Ignore] public void SecondCallLoadFromCache () { var loader = new UriImageSource { @@ -80,7 +80,7 @@ namespace Xamarin.Forms.Core.UnitTests } [Test] - [Ignore("DoNotKeepFailedRetrieveInCache")] + [Ignore] public void DoNotKeepFailedRetrieveInCache () { var loader = new UriImageSource { @@ -98,7 +98,7 @@ namespace Xamarin.Forms.Core.UnitTests } [Test] - [Ignore("ConcurrentCallsOnSameUriAreQueued")] + [Ignore] public void ConcurrentCallsOnSameUriAreQueued () { var loader = new UriImageSource { diff --git a/Xamarin.Forms.Core.UnitTests/Xamarin.Forms.Core.UnitTests.csproj b/Xamarin.Forms.Core.UnitTests/Xamarin.Forms.Core.UnitTests.csproj index 4156eb697..1a994b362 100644 --- a/Xamarin.Forms.Core.UnitTests/Xamarin.Forms.Core.UnitTests.csproj +++ b/Xamarin.Forms.Core.UnitTests/Xamarin.Forms.Core.UnitTests.csproj @@ -45,10 +45,8 @@ - - - 3.13.0 - + + @@ -245,8 +243,8 @@ - <_NUnitTestAdapterFiles Include="$(NuGetPackageRoot)NUnit3TestAdapter\%(Version)\build\net35\**" Condition="@(PackageReference -> '%(Identity)') == 'NUnit3TestAdapter'" InProject="False" /> + <_NUnitTestAdapterFiles Include="$(NuGetPackageRoot)NUnitTestAdapter\%(Version)\**" Condition="@(PackageReference -> '%(Identity)') == 'NUnitTestAdapter'" InProject="False" /> - + - + \ No newline at end of file diff --git a/Xamarin.Forms.Core.Windows.UITests/Xamarin.Forms.Core.Windows.UITests.csproj b/Xamarin.Forms.Core.Windows.UITests/Xamarin.Forms.Core.Windows.UITests.csproj index 5cf4d38f9..9d1a156e0 100644 --- a/Xamarin.Forms.Core.Windows.UITests/Xamarin.Forms.Core.Windows.UITests.csproj +++ b/Xamarin.Forms.Core.Windows.UITests/Xamarin.Forms.Core.Windows.UITests.csproj @@ -49,14 +49,14 @@ - + + + 2.1.1 + - - - 3.13.0 - + diff --git a/Xamarin.Forms.Core.iOS.UITests/Xamarin.Forms.Core.iOS.UITests.csproj b/Xamarin.Forms.Core.iOS.UITests/Xamarin.Forms.Core.iOS.UITests.csproj index 09d3fb49a..1405287af 100644 --- a/Xamarin.Forms.Core.iOS.UITests/Xamarin.Forms.Core.iOS.UITests.csproj +++ b/Xamarin.Forms.Core.iOS.UITests/Xamarin.Forms.Core.iOS.UITests.csproj @@ -46,9 +46,9 @@ - + - + diff --git a/Xamarin.Forms.Core.macOS.UITests/Xamarin.Forms.Core.macOS.UITests.csproj b/Xamarin.Forms.Core.macOS.UITests/Xamarin.Forms.Core.macOS.UITests.csproj index ff9f6d28b..a7afdf533 100644 --- a/Xamarin.Forms.Core.macOS.UITests/Xamarin.Forms.Core.macOS.UITests.csproj +++ b/Xamarin.Forms.Core.macOS.UITests/Xamarin.Forms.Core.macOS.UITests.csproj @@ -48,12 +48,12 @@ - + - + @@ -89,4 +89,4 @@ - \ No newline at end of file + diff --git a/Xamarin.Forms.Pages.UnitTests/Xamarin.Forms.Pages.UnitTests.csproj b/Xamarin.Forms.Pages.UnitTests/Xamarin.Forms.Pages.UnitTests.csproj index 3eddc48c1..4db3aaa88 100644 --- a/Xamarin.Forms.Pages.UnitTests/Xamarin.Forms.Pages.UnitTests.csproj +++ b/Xamarin.Forms.Pages.UnitTests/Xamarin.Forms.Pages.UnitTests.csproj @@ -1,4 +1,4 @@ - + @@ -42,10 +42,8 @@ - - - 3.13.0 - + + @@ -79,8 +77,8 @@ - <_NUnitTestAdapterFiles Include="$(NuGetPackageRoot)NUnit3TestAdapter\%(Version)\build\net35\**" Condition="@(PackageReference -> '%(Identity)') == 'NUnit3TestAdapter'" InProject="False" /> + <_NUnitTestAdapterFiles Include="$(NuGetPackageRoot)NUnitTestAdapter\%(Version)\**" Condition="@(PackageReference -> '%(Identity)') == 'NUnitTestAdapter'" InProject="False" /> - + \ No newline at end of file diff --git a/Xamarin.Forms.Xaml.UnitTests/DesignTimeLoaderTests.cs b/Xamarin.Forms.Xaml.UnitTests/DesignTimeLoaderTests.cs index d791cf807..dd0505b83 100644 --- a/Xamarin.Forms.Xaml.UnitTests/DesignTimeLoaderTests.cs +++ b/Xamarin.Forms.Xaml.UnitTests/DesignTimeLoaderTests.cs @@ -167,7 +167,7 @@ namespace Xamarin.Forms.Xaml.UnitTests Assert.That(page.Content.BackgroundColor, Is.EqualTo(Color.Red)); } - [Test][Ignore(nameof(ImplicitStyleAppliedToMissingType))] + [Test][Ignore] public void ImplicitStyleAppliedToMissingType() { XamlLoader.FallbackTypeResolver = (p, type) => type ?? typeof(Button); @@ -224,7 +224,7 @@ namespace Xamarin.Forms.Xaml.UnitTests Assert.That(myButton.BackgroundColor, Is.Not.EqualTo(Color.Red)); } - [Test][Ignore(nameof(StyleTargetingMissingTypeNotAppliedToFallbackType))] + [Test][Ignore] public void StyleTargetingMissingTypeNotAppliedToFallbackType() { XamlLoader.FallbackTypeResolver = (p, type) => type ?? typeof(Button); diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/GH2691.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/GH2691.xaml.cs index 547e9f292..1c0abe604 100644 --- a/Xamarin.Forms.Xaml.UnitTests/Issues/GH2691.xaml.cs +++ b/Xamarin.Forms.Xaml.UnitTests/Issues/GH2691.xaml.cs @@ -113,17 +113,16 @@ namespace Xamarin.Forms.Xaml.UnitTests "Release"; #endif - var dir = Path.GetFullPath( - Path.Combine( - TestContext.CurrentContext.TestDirectory, "Xamarin.Forms.Controls.dll")); var xamlg = new XamlGTask() { BuildEngine = new DummyBuildEngine(), AssemblyName = "test", Language = "C#", XamlFiles = new[] { item }, - OutputFiles = new[] { new TaskItem(xamlOutputFile) }, - References = dir + OutputFiles = new [] { new TaskItem(xamlOutputFile) }, + References = Path.GetFullPath( + Path.Combine( + Directory.GetCurrentDirectory(), "Xamarin.Forms.Controls.dll")) }; var generator = new XamlGenerator(item, xamlg.Language, xamlg.AssemblyName, xamlOutputFile, xamlg.References, null); diff --git a/Xamarin.Forms.Xaml.UnitTests/LoaderTests.cs b/Xamarin.Forms.Xaml.UnitTests/LoaderTests.cs index 2a1c9fe08..e99a7c604 100644 --- a/Xamarin.Forms.Xaml.UnitTests/LoaderTests.cs +++ b/Xamarin.Forms.Xaml.UnitTests/LoaderTests.cs @@ -795,12 +795,8 @@ namespace Xamarin.Forms.Xaml.UnitTests var bindingType = XamlParser.GetElementType(new XmlType("http://xamarin.com/schemas/2014/forms", "Binding", null), null, null, out var ex); Assert.That(ex, Is.Null); Assert.That(bindingType, Is.EqualTo(typeof(BindingExtension))); - var module = ModuleDefinition.CreateModule("foo", new ModuleParameters() - { - AssemblyResolver = new MockAssemblyResolver(), - Kind = ModuleKind.Dll, - }); - var bindingTypeRef = new XmlType("http://xamarin.com/schemas/2014/forms", "Binding", null).GetTypeReference(module, null); + + var bindingTypeRef = new XmlType("http://xamarin.com/schemas/2014/forms", "Binding", null).GetTypeReference(ModuleDefinition.CreateModule("foo", ModuleKind.Dll), null); Assert.That(bindingType.FullName, Is.EqualTo("Xamarin.Forms.Xaml.BindingExtension")); } } diff --git a/Xamarin.Forms.Xaml.UnitTests/MSBuild/MSBuildTests.cs b/Xamarin.Forms.Xaml.UnitTests/MSBuild/MSBuildTests.cs index 2d0531ea6..c95442556 100644 --- a/Xamarin.Forms.Xaml.UnitTests/MSBuild/MSBuildTests.cs +++ b/Xamarin.Forms.Xaml.UnitTests/MSBuild/MSBuildTests.cs @@ -488,15 +488,15 @@ namespace Xamarin.Forms.MSBuild.UnitTests AssertExists (Path.Combine (intermediateDirectory, "XamlC.stamp")); } - [Test] - public void InvalidXml([Values(false, true)] bool sdkStyle) + [Test, ExpectedException (typeof(AssertionException))] + public void InvalidXml ([Values (false, true)] bool sdkStyle) { - var project = NewProject(sdkStyle); - project.Add(AddFile("MainPage.xaml", "EmbeddedResource", "notxmlatall")); - var projectFile = Path.Combine(tempDirectory, "test.csproj"); - project.Save(projectFile); - RestoreIfNeeded(projectFile, sdkStyle); - Assert.Throws(() => Build(projectFile)); + var project = NewProject (sdkStyle); + project.Add (AddFile ("MainPage.xaml", "EmbeddedResource", "notxmlatall")); + var projectFile = Path.Combine (tempDirectory, "test.csproj"); + project.Save (projectFile); + RestoreIfNeeded (projectFile, sdkStyle); + Build (projectFile); } [Test] diff --git a/Xamarin.Forms.Xaml.UnitTests/MockAssemblyResolver.cs b/Xamarin.Forms.Xaml.UnitTests/MockAssemblyResolver.cs deleted file mode 100644 index 782a7027c..000000000 --- a/Xamarin.Forms.Xaml.UnitTests/MockAssemblyResolver.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Mono.Cecil; -using NUnit.Framework; -using System.IO; - -namespace Xamarin.Forms.Xaml.UnitTests -{ - public class MockAssemblyResolver : BaseAssemblyResolver - { - public override AssemblyDefinition Resolve(AssemblyNameReference name) - { - AssemblyDefinition assembly; - var localPath = Path.GetFullPath(Path.Combine(TestContext.CurrentContext.TestDirectory, $"{name.Name}.dll")); - if (File.Exists(localPath)) - assembly = AssemblyDefinition.ReadAssembly(localPath); - else - assembly = base.Resolve(name); - return assembly; - } - } -} \ No newline at end of file diff --git a/Xamarin.Forms.Xaml.UnitTests/Speed/SimpleContentPage.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Speed/SimpleContentPage.xaml.cs index 2e3c59d0b..bdf291e78 100644 --- a/Xamarin.Forms.Xaml.UnitTests/Speed/SimpleContentPage.xaml.cs +++ b/Xamarin.Forms.Xaml.UnitTests/Speed/SimpleContentPage.xaml.cs @@ -46,7 +46,7 @@ namespace Xamarin.Forms.Xaml.UnitTests } [Test] - [Ignore(nameof(XamlCIs20TimesFasterThanXaml))] + [Ignore] public void XamlCIs20TimesFasterThanXaml () { var swXamlC = new Stopwatch (); @@ -66,7 +66,7 @@ namespace Xamarin.Forms.Xaml.UnitTests } [Test] - [Ignore(nameof(XamlCIsNotMuchSlowerThanCode))] + [Ignore] public void XamlCIsNotMuchSlowerThanCode () { var swXamlC = new Stopwatch (); diff --git a/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj b/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj index f2a7026c0..df79154f4 100644 --- a/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj +++ b/Xamarin.Forms.Xaml.UnitTests/Xamarin.Forms.Xaml.UnitTests.csproj @@ -4,7 +4,7 @@ Xamarin.Forms.Xaml.UnitTests Xamarin.Forms.Xaml.UnitTests 4 - 0672;0219;0414;CS0436 + 0672;0219;0414 @@ -19,9 +19,8 @@ - - - + + diff --git a/Xamarin.Forms.Xaml.UnitTests/XamlC/FieldReferenceExtensionsTests.cs b/Xamarin.Forms.Xaml.UnitTests/XamlC/FieldReferenceExtensionsTests.cs index 054a3aea4..bcea09fc2 100644 --- a/Xamarin.Forms.Xaml.UnitTests/XamlC/FieldReferenceExtensionsTests.cs +++ b/Xamarin.Forms.Xaml.UnitTests/XamlC/FieldReferenceExtensionsTests.cs @@ -6,7 +6,6 @@ using Mono.Cecil; using Xamarin.Forms.Build.Tasks; using NUnit.Framework; -using Xamarin.Forms.Xaml.UnitTests; namespace Xamarin.Forms.XamlcUnitTests { @@ -32,11 +31,7 @@ namespace Xamarin.Forms.XamlcUnitTests [SetUp] public void SetUp () { - module = ModuleDefinition.CreateModule("foo", new ModuleParameters() - { - AssemblyResolver = new MockAssemblyResolver(), - Kind = ModuleKind.Dll, - }); + module = ModuleDefinition.CreateModule ("foo", ModuleKind.Dll); } [Test] diff --git a/Xamarin.Forms.Xaml.UnitTests/XamlC/MethodDefinitionExtensionsTests.cs b/Xamarin.Forms.Xaml.UnitTests/XamlC/MethodDefinitionExtensionsTests.cs index 13cb08442..82a1c1e93 100644 --- a/Xamarin.Forms.Xaml.UnitTests/XamlC/MethodDefinitionExtensionsTests.cs +++ b/Xamarin.Forms.Xaml.UnitTests/XamlC/MethodDefinitionExtensionsTests.cs @@ -7,7 +7,6 @@ using Xamarin.Forms.Build.Tasks; using NUnit.Framework; using System.Collections.Generic; -using Xamarin.Forms.Xaml.UnitTests; namespace Xamarin.Forms.XamlcUnitTests { @@ -34,11 +33,7 @@ namespace Xamarin.Forms.XamlcUnitTests [SetUp] public void SetUp() { - module = ModuleDefinition.CreateModule("foo", new ModuleParameters() - { - AssemblyResolver = new MockAssemblyResolver(), - Kind = ModuleKind.Dll, - }); + module = ModuleDefinition.CreateModule("foo", ModuleKind.Dll); } [Test] diff --git a/Xamarin.Forms.Xaml.UnitTests/XamlC/MethodReferenceExtensionsTests.cs b/Xamarin.Forms.Xaml.UnitTests/XamlC/MethodReferenceExtensionsTests.cs index 29e607882..b59c90e0e 100644 --- a/Xamarin.Forms.Xaml.UnitTests/XamlC/MethodReferenceExtensionsTests.cs +++ b/Xamarin.Forms.Xaml.UnitTests/XamlC/MethodReferenceExtensionsTests.cs @@ -1,3 +1,4 @@ +using System; using System.Linq; using Mono.Cecil; @@ -6,7 +7,6 @@ using Xamarin.Forms.Build.Tasks; using NUnit.Framework; using System.Collections.Generic; -using Xamarin.Forms.Xaml.UnitTests; namespace Xamarin.Forms.XamlcUnitTests { @@ -23,13 +23,9 @@ namespace Xamarin.Forms.XamlcUnitTests } [SetUp] - public void SetUp() + public void SetUp () { - module = ModuleDefinition.CreateModule("foo", new ModuleParameters() - { - AssemblyResolver = new MockAssemblyResolver(), - Kind = ModuleKind.Dll, - }); + module = ModuleDefinition.CreateModule ("foo", ModuleKind.Dll); } [Test] diff --git a/Xamarin.Forms.Xaml.UnitTests/XamlParseExceptionConstraint.cs b/Xamarin.Forms.Xaml.UnitTests/XamlParseExceptionConstraint.cs index 773f3e6c7..cdff5ca85 100644 --- a/Xamarin.Forms.Xaml.UnitTests/XamlParseExceptionConstraint.cs +++ b/Xamarin.Forms.Xaml.UnitTests/XamlParseExceptionConstraint.cs @@ -2,7 +2,7 @@ using System; using NUnit.Framework.Constraints; namespace Xamarin.Forms.Xaml.UnitTests -{ +{ public class XamlParseExceptionConstraint : ExceptionTypeConstraint { bool haslineinfo; @@ -10,14 +10,13 @@ namespace Xamarin.Forms.Xaml.UnitTests int lineposition; Func messagePredicate; - XamlParseExceptionConstraint(bool haslineinfo) : base(typeof(XamlParseException)) + XamlParseExceptionConstraint (bool haslineinfo) : base (typeof (XamlParseException)) { this.haslineinfo = haslineinfo; + DisplayName = "xamlparse"; } - public override string DisplayName => "xamlparse"; - - public XamlParseExceptionConstraint() : this(false) + public XamlParseExceptionConstraint () : this (false) { } @@ -28,8 +27,9 @@ namespace Xamarin.Forms.Xaml.UnitTests this.messagePredicate = messagePredicate; } - protected override bool Matches (object actual) + public override bool Matches (object actual) { + this.actual = actual; if (!base.Matches (actual)) return false; var xmlInfo = ((XamlParseException)actual).XmlInfo; @@ -43,30 +43,25 @@ namespace Xamarin.Forms.Xaml.UnitTests return xmlInfo.LineNumber == linenumber && xmlInfo.LinePosition == lineposition; } - public override string Description + public override void WriteDescriptionTo (MessageWriter writer) { - get - { - if (haslineinfo) - { - return string.Format($"{base.Description} line {linenumber}, position {lineposition}"); - } - return base.Description; - } + base.WriteDescriptionTo (writer); + if (haslineinfo) + writer.Write (string.Format (" line {0}, position {1}", linenumber, lineposition)); } - //public override void WriteActualValueTo (MessageWriter writer) - //{ - // var ex = actual as XamlParseException; - // writer.WriteActualValue ((actual == null) ? null : actual.GetType ()); - // if (ex != null) { - // if (ex.XmlInfo != null && ex.XmlInfo.HasLineInfo ()) - // writer.Write (" line {0}, position {1}", ex.XmlInfo.LineNumber, ex.XmlInfo.LinePosition); - // else - // writer.Write (" no line info"); - // writer.WriteLine (" ({0})", ex.Message); - // writer.Write (ex.StackTrace); - // } - //} + public override void WriteActualValueTo (MessageWriter writer) + { + var ex = actual as XamlParseException; + writer.WriteActualValue ((actual == null) ? null : actual.GetType ()); + if (ex != null) { + if (ex.XmlInfo != null && ex.XmlInfo.HasLineInfo ()) + writer.Write (" line {0}, position {1}", ex.XmlInfo.LineNumber, ex.XmlInfo.LinePosition); + else + writer.Write (" no line info"); + writer.WriteLine (" ({0})", ex.Message); + writer.Write (ex.StackTrace); + } + } } } \ No newline at end of file