Esempio n. 1
0
        private void SetupJavaScriptLibraryController(params JavaScriptLibrary[] libraries)
        {
            var libraryController = new Mock <IJavaScriptLibraryController>();

            libraryController.Setup(lc => lc.GetLibraries()).Returns(libraries);
            libraryController.Setup(lc => lc.GetLibrary(It.IsAny <Func <JavaScriptLibrary, bool> >())).Returns((Func <JavaScriptLibrary, bool> predicate) => libraries.SingleOrDefault(predicate));
            libraryController.Setup(lc => lc.GetLibraries(It.IsAny <Func <JavaScriptLibrary, bool> >())).Returns((Func <JavaScriptLibrary, bool> predicate) => libraries.Where(predicate));
            JavaScriptLibraryController.SetTestableInstance(libraryController.Object);
        }
Esempio n. 2
0
 public void TearDown()
 {
     UnitTestHelper.ClearHttpContext();
     JavaScriptLibraryController.ClearInstance();
 }
Esempio n. 3
0
 public void TearDown()
 {
     UnitTestHelper.ClearHttpContext();
     JavaScriptLibraryController.ClearInstance();
     Globals.DependencyProvider = null;
 }