Browse Source

fix more tests.

pull/4334/head
Dan Walmsley 6 years ago
parent
commit
4aa51e80da
  1. 4
      tests/Avalonia.Controls.UnitTests/WindowBaseTests.cs
  2. 6
      tests/Avalonia.Controls.UnitTests/WindowTests.cs

4
tests/Avalonia.Controls.UnitTests/WindowBaseTests.cs

@ -111,6 +111,7 @@ namespace Avalonia.Controls.UnitTests
{
var windowImpl = new Mock<IPopupImpl>();
windowImpl.Setup(x => x.DesktopScaling).Returns(1);
windowImpl.Setup(x => x.RenderScaling).Returns(1);
windowImpl.SetupProperty(x => x.Closed);
using (UnitTestApplication.Start(TestServices.StyledWindow))
@ -129,6 +130,7 @@ namespace Avalonia.Controls.UnitTests
{
var windowImpl = new Mock<IPopupImpl>();
windowImpl.Setup(x => x.DesktopScaling).Returns(1);
windowImpl.Setup(x => x.RenderScaling).Returns(1);
using (UnitTestApplication.Start(TestServices.StyledWindow))
{
@ -144,6 +146,7 @@ namespace Avalonia.Controls.UnitTests
{
var windowImpl = new Mock<IPopupImpl>();
windowImpl.Setup(x => x.DesktopScaling).Returns(1);
windowImpl.Setup(x => x.RenderScaling).Returns(1);
using (UnitTestApplication.Start(TestServices.StyledWindow))
{
@ -209,6 +212,7 @@ namespace Avalonia.Controls.UnitTests
var renderer = new Mock<IRenderer>();
var windowImpl = new Mock<IPopupImpl>();
windowImpl.Setup(x => x.DesktopScaling).Returns(1);
windowImpl.Setup(x => x.RenderScaling).Returns(1);
windowImpl.SetupProperty(x => x.Closed);
windowImpl.Setup(x => x.CreateRenderer(It.IsAny<IRenderRoot>())).Returns(renderer.Object);

6
tests/Avalonia.Controls.UnitTests/WindowTests.cs

@ -101,6 +101,7 @@ namespace Avalonia.Controls.UnitTests
var windowImpl = new Mock<IWindowImpl>();
windowImpl.SetupProperty(x => x.Closed);
windowImpl.Setup(x => x.DesktopScaling).Returns(1);
windowImpl.Setup(x => x.RenderScaling).Returns(1);
var services = TestServices.StyledWindow.With(
windowingPlatform: new MockWindowingPlatform(() => windowImpl.Object));
@ -207,6 +208,7 @@ namespace Avalonia.Controls.UnitTests
var windowImpl = new Mock<IWindowImpl>();
windowImpl.SetupProperty(x => x.Closed);
windowImpl.Setup(x => x.DesktopScaling).Returns(1);
windowImpl.Setup(x => x.RenderScaling).Returns(1);
var target = new Window(windowImpl.Object);
var task = target.ShowDialog<bool>(parent.Object);
@ -246,6 +248,7 @@ namespace Avalonia.Controls.UnitTests
var windowImpl = new Mock<IWindowImpl>();
windowImpl.SetupProperty(x => x.Closed);
windowImpl.Setup(x => x.DesktopScaling).Returns(1);
windowImpl.Setup(x => x.RenderScaling).Returns(1);
var target = new Window(windowImpl.Object);
var task = target.ShowDialog<bool>(parent.Object);
@ -274,6 +277,7 @@ namespace Avalonia.Controls.UnitTests
var windowImpl = MockWindowingPlatform.CreateWindowMock();
windowImpl.Setup(x => x.ClientSize).Returns(new Size(800, 480));
windowImpl.Setup(x => x.DesktopScaling).Returns(1);
windowImpl.Setup(x => x.RenderScaling).Returns(1);
windowImpl.Setup(x => x.Screen).Returns(screens.Object);
using (UnitTestApplication.Start(TestServices.StyledWindow))
@ -299,11 +303,13 @@ namespace Avalonia.Controls.UnitTests
parentWindowImpl.Setup(x => x.ClientSize).Returns(new Size(800, 480));
parentWindowImpl.Setup(x => x.MaxAutoSizeHint).Returns(new Size(1920, 1080));
parentWindowImpl.Setup(x => x.DesktopScaling).Returns(1);
parentWindowImpl.Setup(x => x.RenderScaling).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.DesktopScaling).Returns(1);
windowImpl.Setup(x => x.RenderScaling).Returns(1);
var parentWindowServices = TestServices.StyledWindow.With(
windowingPlatform: new MockWindowingPlatform(() => parentWindowImpl.Object));

Loading…
Cancel
Save