From 2ad40026865fd2189fbabfaa20df1bdbd56f06ce Mon Sep 17 00:00:00 2001 From: Dan Walmsley Date: Mon, 20 Jul 2020 16:56:00 -0300 Subject: [PATCH] fix unit tests. --- .../DesktopStyleApplicationLifetimeTests.cs | 2 +- tests/Avalonia.Controls.UnitTests/WindowBaseTests.cs | 8 ++++---- tests/Avalonia.Controls.UnitTests/WindowTests.cs | 12 ++++++------ tests/Avalonia.UnitTests/MockWindowingPlatform.cs | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/Avalonia.Controls.UnitTests/DesktopStyleApplicationLifetimeTests.cs b/tests/Avalonia.Controls.UnitTests/DesktopStyleApplicationLifetimeTests.cs index e6deabfe25..837a62f40e 100644 --- a/tests/Avalonia.Controls.UnitTests/DesktopStyleApplicationLifetimeTests.cs +++ b/tests/Avalonia.Controls.UnitTests/DesktopStyleApplicationLifetimeTests.cs @@ -191,7 +191,7 @@ namespace Avalonia.Controls.UnitTests { var windowImpl = new Mock(); windowImpl.SetupProperty(x => x.Closed); - windowImpl.Setup(x => x.RenderScaling).Returns(1); + windowImpl.Setup(x => x.DesktopScaling).Returns(1); var services = TestServices.StyledWindow.With( windowingPlatform: new MockWindowingPlatform(() => windowImpl.Object)); diff --git a/tests/Avalonia.Controls.UnitTests/WindowBaseTests.cs b/tests/Avalonia.Controls.UnitTests/WindowBaseTests.cs index 7e3130377f..1c72eb5069 100644 --- a/tests/Avalonia.Controls.UnitTests/WindowBaseTests.cs +++ b/tests/Avalonia.Controls.UnitTests/WindowBaseTests.cs @@ -110,7 +110,7 @@ namespace Avalonia.Controls.UnitTests public void IsVisible_Should_Be_False_Atfer_Impl_Signals_Close() { var windowImpl = new Mock(); - windowImpl.Setup(x => x.RenderScaling).Returns(1); + windowImpl.Setup(x => x.DesktopScaling).Returns(1); windowImpl.SetupProperty(x => x.Closed); using (UnitTestApplication.Start(TestServices.StyledWindow)) @@ -128,7 +128,7 @@ namespace Avalonia.Controls.UnitTests public void Setting_IsVisible_True_Shows_Window() { var windowImpl = new Mock(); - windowImpl.Setup(x => x.RenderScaling).Returns(1); + windowImpl.Setup(x => x.DesktopScaling).Returns(1); using (UnitTestApplication.Start(TestServices.StyledWindow)) { @@ -143,7 +143,7 @@ namespace Avalonia.Controls.UnitTests public void Setting_IsVisible_False_Hides_Window() { var windowImpl = new Mock(); - windowImpl.Setup(x => x.RenderScaling).Returns(1); + windowImpl.Setup(x => x.DesktopScaling).Returns(1); using (UnitTestApplication.Start(TestServices.StyledWindow)) { @@ -208,7 +208,7 @@ namespace Avalonia.Controls.UnitTests { var renderer = new Mock(); var windowImpl = new Mock(); - windowImpl.Setup(x => x.RenderScaling).Returns(1); + windowImpl.Setup(x => x.DesktopScaling).Returns(1); windowImpl.SetupProperty(x => x.Closed); windowImpl.Setup(x => x.CreateRenderer(It.IsAny())).Returns(renderer.Object); diff --git a/tests/Avalonia.Controls.UnitTests/WindowTests.cs b/tests/Avalonia.Controls.UnitTests/WindowTests.cs index 2b736ae38b..5cf65115bb 100644 --- a/tests/Avalonia.Controls.UnitTests/WindowTests.cs +++ b/tests/Avalonia.Controls.UnitTests/WindowTests.cs @@ -100,7 +100,7 @@ namespace Avalonia.Controls.UnitTests { var windowImpl = new Mock(); windowImpl.SetupProperty(x => x.Closed); - windowImpl.Setup(x => x.RenderScaling).Returns(1); + windowImpl.Setup(x => x.DesktopScaling).Returns(1); var services = TestServices.StyledWindow.With( windowingPlatform: new MockWindowingPlatform(() => windowImpl.Object)); @@ -206,7 +206,7 @@ namespace Avalonia.Controls.UnitTests var parent = new Mock(); var windowImpl = new Mock(); windowImpl.SetupProperty(x => x.Closed); - windowImpl.Setup(x => x.RenderScaling).Returns(1); + windowImpl.Setup(x => x.DesktopScaling).Returns(1); var target = new Window(windowImpl.Object); var task = target.ShowDialog(parent.Object); @@ -245,7 +245,7 @@ namespace Avalonia.Controls.UnitTests var parent = new Mock(); var windowImpl = new Mock(); windowImpl.SetupProperty(x => x.Closed); - windowImpl.Setup(x => x.RenderScaling).Returns(1); + windowImpl.Setup(x => x.DesktopScaling).Returns(1); var target = new Window(windowImpl.Object); var task = target.ShowDialog(parent.Object); @@ -273,7 +273,7 @@ namespace Avalonia.Controls.UnitTests var windowImpl = MockWindowingPlatform.CreateWindowMock(); windowImpl.Setup(x => x.ClientSize).Returns(new Size(800, 480)); - windowImpl.Setup(x => x.RenderScaling).Returns(1); + windowImpl.Setup(x => x.DesktopScaling).Returns(1); windowImpl.Setup(x => x.Screen).Returns(screens.Object); using (UnitTestApplication.Start(TestServices.StyledWindow)) @@ -298,12 +298,12 @@ namespace Avalonia.Controls.UnitTests var parentWindowImpl = MockWindowingPlatform.CreateWindowMock(); parentWindowImpl.Setup(x => x.ClientSize).Returns(new Size(800, 480)); parentWindowImpl.Setup(x => x.MaxAutoSizeHint).Returns(new Size(1920, 1080)); - parentWindowImpl.Setup(x => x.RenderScaling).Returns(1); + parentWindowImpl.Setup(x => x.DesktopScaling).Returns(1); var windowImpl = MockWindowingPlatform.CreateWindowMock(); windowImpl.Setup(x => x.ClientSize).Returns(new Size(320, 200)); windowImpl.Setup(x => x.MaxAutoSizeHint).Returns(new Size(1920, 1080)); - windowImpl.Setup(x => x.RenderScaling).Returns(1); + windowImpl.Setup(x => x.DesktopScaling).Returns(1); var parentWindowServices = TestServices.StyledWindow.With( windowingPlatform: new MockWindowingPlatform(() => parentWindowImpl.Object)); diff --git a/tests/Avalonia.UnitTests/MockWindowingPlatform.cs b/tests/Avalonia.UnitTests/MockWindowingPlatform.cs index e5fcce13c0..e265b49af3 100644 --- a/tests/Avalonia.UnitTests/MockWindowingPlatform.cs +++ b/tests/Avalonia.UnitTests/MockWindowingPlatform.cs @@ -29,7 +29,7 @@ namespace Avalonia.UnitTests windowImpl.SetupAllProperties(); windowImpl.Setup(x => x.ClientSize).Returns(() => clientSize); windowImpl.Setup(x => x.MaxAutoSizeHint).Returns(s_screenSize); - windowImpl.Setup(x => x.RenderScaling).Returns(1); + windowImpl.Setup(x => x.DesktopScaling).Returns(1); windowImpl.Setup(x => x.Screen).Returns(CreateScreenMock().Object); windowImpl.Setup(x => x.Position).Returns(() => position); SetupToplevel(windowImpl);