Browse Source

Fixed failing tests.

pull/707/head
Jeremy Koritzinsky 10 years ago
parent
commit
1429c4dd95
  1. 8
      tests/Avalonia.Controls.UnitTests/Primitives/PopupTests.cs
  2. 3
      tests/Avalonia.UnitTests/TestServices.cs

8
tests/Avalonia.Controls.UnitTests/Primitives/PopupTests.cs

@ -249,12 +249,16 @@ namespace Avalonia.Controls.UnitTests.Primitives
var globalStyles = new Mock<IGlobalStyles>();
globalStyles.Setup(x => x.Styles).Returns(styles);
var renderInterface = new Mock<IPlatformRenderInterface>();
renderInterface.Setup(x => x.CreateRenderer(It.IsAny<IPlatformHandle>())).Returns(() => new Mock<IRenderTarget>().Object);
AvaloniaLocator.CurrentMutable
.Bind<ILayoutManager>().ToTransient<LayoutManager>()
.Bind<IGlobalStyles>().ToFunc(() => globalStyles.Object)
.Bind<IWindowingPlatform>().ToConstant(new WindowingPlatformMock())
.Bind<IStyler>().ToTransient<Styler>();
.Bind<IStyler>().ToTransient<Styler>()
.Bind<IPlatformRenderInterface>().ToFunc(() => renderInterface.Object);
return result;
}

3
tests/Avalonia.UnitTests/TestServices.cs

@ -152,7 +152,8 @@ namespace Avalonia.UnitTests
It.IsAny<FontWeight>(),
It.IsAny<TextWrapping>()) == Mock.Of<IFormattedTextImpl>() &&
x.CreateStreamGeometry() == Mock.Of<IStreamGeometryImpl>(
y => y.Open() == Mock.Of<IStreamGeometryContextImpl>()));
y => y.Open() == Mock.Of<IStreamGeometryContextImpl>()) &&
x.CreateRenderer(It.IsAny<IPlatformHandle>()) == Mock.Of<IRenderTarget>());
}
}
}

Loading…
Cancel
Save