Browse Source

Fixed failing tests.

Jeremy Koritzinsky 9 years ago
parent
commit
1429c4dd95

+ 6 - 2
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;
         }
 

+ 2 - 1
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>());
         }
     }
 }