Xamarin.Forms/Xamarin.Forms.Platform.iOS..../ScaleTests.cs

34 строки
938 B
C#
Исходник Обычный вид История

using System.Collections;
using System.Threading.Tasks;
Add more platform tests (#9011) * Add a platform test to check for Bugzilla 35738 * Delete the Bugzilla35738 UI test * Bold the start of fixtures Fix typo * Add some background color tests for iOS * Add test for iOS Button BackgroundColor * Remove changes to PerformanceTrackerRenderer * Split classes into files * Add UWP testing platform * Cache default font size * Run UWP tests on main thread * Use GetOrCreateRenderer * Split Test and Description attributes; clean up iOS background color tests * Opacity tests on iOS * Some background color tests for UWP * BackgroundColorTests for UWP for most controls * Shortcut key to get to platform tests on UWP * Button background color test for Android * BackgroundColor tests for Android controls * Opacity tests for Android * Ignore Opacity tests for iOS/Android (replaced by platform tests) * Remove unused empty BackgroundColor test * IsEnabled tests for Android * Consolidate basic VisualElement list * Apply categories for generate test cases * Consolidate element list * IsEnabled tests for iOS * Ignore tests covered by platform tests * Fix incorrect overrides * Rotation tests for Android * Rotation tests for iOS * Set UI test versions to Ignore * Rotation tests for UWP * Scale tests for iOS * ScaleX and ScaleY tests for Android * Android TranslationX and TranslationY tests * Ignore TranslationX/Y for manual review on Android * Ignore tests covered by platform tests * Add Sliders to the Android/iOS tests * Add Slider to UWP tests * Ignore tests for Slider that're already covered * Add ImageButton to the platform tests * Ignore duplicate tests for ImageButton * Add IsVisible tests for Android/iOS * Ignore IsVisible tests covered by platform tests * Fix usings for AndroidX * BoxView tests for Android * Add test counter to platform test console * BoxView tests for iOS * Ignore duplicate tests for BoxView * Frame tests for Android * Add Frame tests on iOS * Ignore duplicate tests * Add Button and Label text tests for Android/iOS * Ignore duplicate text test for Button * Add more controls to UWP tests; add IsEnabled tests for UWP * Add scale tests for UWP * Ignore UWP tests covered by platform tests * Mark Issue968 test as manual review * Replace 8269 UI test with platform test * Move 8682 from UI test to platform test * Mark Issue8004 test for manual review * Adding manual review attribute for Bugzilla29128 * Show bitmaps for failed color tests on Android; create BoxView CornerRadius test * Functional color-at-point tests * Clean up Android pixel checking code; add more CornerRadius tests * Fix NRE in FrameRenderer * Ignore Frame * Fix cross-thread dispose issues with StepperRenderer and SliderRenderer * Add tolerance for color comparisons * Parent Frame for older API versions * Remove assertion not supported before iOS 12 * Address fast label renderer, changes in BoxView, and a bug in Android fast button
2020-02-22 02:54:57 +03:00
using NUnit.Framework;
using static Xamarin.Forms.Core.UITests.NumericExtensions;
using static Xamarin.Forms.Core.UITests.ParsingUtils;
namespace Xamarin.Forms.Platform.iOS.UnitTests
Add more platform tests (#9011) * Add a platform test to check for Bugzilla 35738 * Delete the Bugzilla35738 UI test * Bold the start of fixtures Fix typo * Add some background color tests for iOS * Add test for iOS Button BackgroundColor * Remove changes to PerformanceTrackerRenderer * Split classes into files * Add UWP testing platform * Cache default font size * Run UWP tests on main thread * Use GetOrCreateRenderer * Split Test and Description attributes; clean up iOS background color tests * Opacity tests on iOS * Some background color tests for UWP * BackgroundColorTests for UWP for most controls * Shortcut key to get to platform tests on UWP * Button background color test for Android * BackgroundColor tests for Android controls * Opacity tests for Android * Ignore Opacity tests for iOS/Android (replaced by platform tests) * Remove unused empty BackgroundColor test * IsEnabled tests for Android * Consolidate basic VisualElement list * Apply categories for generate test cases * Consolidate element list * IsEnabled tests for iOS * Ignore tests covered by platform tests * Fix incorrect overrides * Rotation tests for Android * Rotation tests for iOS * Set UI test versions to Ignore * Rotation tests for UWP * Scale tests for iOS * ScaleX and ScaleY tests for Android * Android TranslationX and TranslationY tests * Ignore TranslationX/Y for manual review on Android * Ignore tests covered by platform tests * Add Sliders to the Android/iOS tests * Add Slider to UWP tests * Ignore tests for Slider that're already covered * Add ImageButton to the platform tests * Ignore duplicate tests for ImageButton * Add IsVisible tests for Android/iOS * Ignore IsVisible tests covered by platform tests * Fix usings for AndroidX * BoxView tests for Android * Add test counter to platform test console * BoxView tests for iOS * Ignore duplicate tests for BoxView * Frame tests for Android * Add Frame tests on iOS * Ignore duplicate tests * Add Button and Label text tests for Android/iOS * Ignore duplicate text test for Button * Add more controls to UWP tests; add IsEnabled tests for UWP * Add scale tests for UWP * Ignore UWP tests covered by platform tests * Mark Issue968 test as manual review * Replace 8269 UI test with platform test * Move 8682 from UI test to platform test * Mark Issue8004 test for manual review * Adding manual review attribute for Bugzilla29128 * Show bitmaps for failed color tests on Android; create BoxView CornerRadius test * Functional color-at-point tests * Clean up Android pixel checking code; add more CornerRadius tests * Fix NRE in FrameRenderer * Ignore Frame * Fix cross-thread dispose issues with StepperRenderer and SliderRenderer * Add tolerance for color comparisons * Parent Frame for older API versions * Remove assertion not supported before iOS 12 * Address fast label renderer, changes in BoxView, and a bug in Android fast button
2020-02-22 02:54:57 +03:00
{
[TestFixture]
public class ScaleTests : PlatformTestFixture
{
static IEnumerable ScaleCases
{
get
{
foreach (var element in BasicViews)
{
element.Scale = 2.0;
yield return CreateTestCase(element);
}
}
}
[Test, Category("Scale"), TestCaseSource(nameof(ScaleCases))]
[Description("View scale should match renderer scale")]
public async Task ScaleConsistent(View view)
Add more platform tests (#9011) * Add a platform test to check for Bugzilla 35738 * Delete the Bugzilla35738 UI test * Bold the start of fixtures Fix typo * Add some background color tests for iOS * Add test for iOS Button BackgroundColor * Remove changes to PerformanceTrackerRenderer * Split classes into files * Add UWP testing platform * Cache default font size * Run UWP tests on main thread * Use GetOrCreateRenderer * Split Test and Description attributes; clean up iOS background color tests * Opacity tests on iOS * Some background color tests for UWP * BackgroundColorTests for UWP for most controls * Shortcut key to get to platform tests on UWP * Button background color test for Android * BackgroundColor tests for Android controls * Opacity tests for Android * Ignore Opacity tests for iOS/Android (replaced by platform tests) * Remove unused empty BackgroundColor test * IsEnabled tests for Android * Consolidate basic VisualElement list * Apply categories for generate test cases * Consolidate element list * IsEnabled tests for iOS * Ignore tests covered by platform tests * Fix incorrect overrides * Rotation tests for Android * Rotation tests for iOS * Set UI test versions to Ignore * Rotation tests for UWP * Scale tests for iOS * ScaleX and ScaleY tests for Android * Android TranslationX and TranslationY tests * Ignore TranslationX/Y for manual review on Android * Ignore tests covered by platform tests * Add Sliders to the Android/iOS tests * Add Slider to UWP tests * Ignore tests for Slider that're already covered * Add ImageButton to the platform tests * Ignore duplicate tests for ImageButton * Add IsVisible tests for Android/iOS * Ignore IsVisible tests covered by platform tests * Fix usings for AndroidX * BoxView tests for Android * Add test counter to platform test console * BoxView tests for iOS * Ignore duplicate tests for BoxView * Frame tests for Android * Add Frame tests on iOS * Ignore duplicate tests * Add Button and Label text tests for Android/iOS * Ignore duplicate text test for Button * Add more controls to UWP tests; add IsEnabled tests for UWP * Add scale tests for UWP * Ignore UWP tests covered by platform tests * Mark Issue968 test as manual review * Replace 8269 UI test with platform test * Move 8682 from UI test to platform test * Mark Issue8004 test for manual review * Adding manual review attribute for Bugzilla29128 * Show bitmaps for failed color tests on Android; create BoxView CornerRadius test * Functional color-at-point tests * Clean up Android pixel checking code; add more CornerRadius tests * Fix NRE in FrameRenderer * Ignore Frame * Fix cross-thread dispose issues with StepperRenderer and SliderRenderer * Add tolerance for color comparisons * Parent Frame for older API versions * Remove assertion not supported before iOS 12 * Address fast label renderer, changes in BoxView, and a bug in Android fast button
2020-02-22 02:54:57 +03:00
{
var transform = await GetRendererProperty(view, r => r.NativeView.Layer.Transform, requiresLayout: true);
var actual = ParseCATransform3D(transform.ToString());
var expected = BuildScaleMatrix((float)view.Scale);
Assert.That(actual, Is.EqualTo(expected));
Add more platform tests (#9011) * Add a platform test to check for Bugzilla 35738 * Delete the Bugzilla35738 UI test * Bold the start of fixtures Fix typo * Add some background color tests for iOS * Add test for iOS Button BackgroundColor * Remove changes to PerformanceTrackerRenderer * Split classes into files * Add UWP testing platform * Cache default font size * Run UWP tests on main thread * Use GetOrCreateRenderer * Split Test and Description attributes; clean up iOS background color tests * Opacity tests on iOS * Some background color tests for UWP * BackgroundColorTests for UWP for most controls * Shortcut key to get to platform tests on UWP * Button background color test for Android * BackgroundColor tests for Android controls * Opacity tests for Android * Ignore Opacity tests for iOS/Android (replaced by platform tests) * Remove unused empty BackgroundColor test * IsEnabled tests for Android * Consolidate basic VisualElement list * Apply categories for generate test cases * Consolidate element list * IsEnabled tests for iOS * Ignore tests covered by platform tests * Fix incorrect overrides * Rotation tests for Android * Rotation tests for iOS * Set UI test versions to Ignore * Rotation tests for UWP * Scale tests for iOS * ScaleX and ScaleY tests for Android * Android TranslationX and TranslationY tests * Ignore TranslationX/Y for manual review on Android * Ignore tests covered by platform tests * Add Sliders to the Android/iOS tests * Add Slider to UWP tests * Ignore tests for Slider that're already covered * Add ImageButton to the platform tests * Ignore duplicate tests for ImageButton * Add IsVisible tests for Android/iOS * Ignore IsVisible tests covered by platform tests * Fix usings for AndroidX * BoxView tests for Android * Add test counter to platform test console * BoxView tests for iOS * Ignore duplicate tests for BoxView * Frame tests for Android * Add Frame tests on iOS * Ignore duplicate tests * Add Button and Label text tests for Android/iOS * Ignore duplicate text test for Button * Add more controls to UWP tests; add IsEnabled tests for UWP * Add scale tests for UWP * Ignore UWP tests covered by platform tests * Mark Issue968 test as manual review * Replace 8269 UI test with platform test * Move 8682 from UI test to platform test * Mark Issue8004 test for manual review * Adding manual review attribute for Bugzilla29128 * Show bitmaps for failed color tests on Android; create BoxView CornerRadius test * Functional color-at-point tests * Clean up Android pixel checking code; add more CornerRadius tests * Fix NRE in FrameRenderer * Ignore Frame * Fix cross-thread dispose issues with StepperRenderer and SliderRenderer * Add tolerance for color comparisons * Parent Frame for older API versions * Remove assertion not supported before iOS 12 * Address fast label renderer, changes in BoxView, and a bug in Android fast button
2020-02-22 02:54:57 +03:00
}
}
}