public void AvaliableThemes() { // Arrange var mockParentDir = new Mock <VirtualDirectory>("parent"); mockParentDir.SetupGet(v => v.Name).Returns("parent"); var mockDir = new Mock <VirtualDirectory>("bar"); mockDir.SetupGet(v => v.Name).Returns("bar"); mockParentDir.SetupGet(v => v.Directories).Returns(new[] { mockDir.Object }); var vpp = new Mock <VirtualPathProvider>(); vpp.Setup(v => v.GetDirectory("parent")).Returns(mockParentDir.Object); // Act var actual = Themes.GetAvailableThemes(vpp.Object, "parent"); // Assert Assert.AreEqual(1, actual.Count); Assert.AreEqual("bar", actual[0]); }