Exemplo n.º 1
0
        public void TestSearchLocationTogglesSearchingStatus() {
            Assert.ExpectAsserts(2);

            MockFlickrService flickrService = new MockFlickrService();
            PageModel pageModel = new PageModel(flickrService, null);

            pageModel.SearchLocation("xyz", 0, 0);
            Assert.IsTrue(pageModel.Searching, "Expected model to report true for Searching.");

            Window.SetTimeout(delegate() {
                PhotoResult[] dummyResults = new PhotoResult[0];

                flickrService.InvokeCallback(dummyResults);
                Assert.IsTrue(pageModel.Searching == false, "Expected model to report false for Searching.");

                TestEngine.ResumeOnAsyncCompleted();
            }, 2000);

            TestEngine.WaitForAsyncCompletion();
        }
Exemplo n.º 2
0
        public void TestSearchLocationTogglesSearchingStatus()
        {
            Assert.ExpectAsserts(2);

            MockFlickrService flickrService = new MockFlickrService();
            PageModel         pageModel     = new PageModel(flickrService, null);

            pageModel.SearchLocation("xyz", 0, 0);
            Assert.IsTrue(pageModel.Searching, "Expected model to report true for Searching.");

            Script.SetTimeout(delegate() {
                PhotoResult[] dummyResults = new PhotoResult[0];

                flickrService.InvokeCallback(dummyResults);
                Assert.IsTrue(pageModel.Searching == false, "Expected model to report false for Searching.");

                TestEngine.ResumeOnAsyncCompleted();
            }, 2000);

            TestEngine.WaitForAsyncCompletion();
        }