Exemple #1
0
        public void Should_EnterSearchFailedState_When_AbortSearch()
        {
            var session = new UpdateSessionFake(true);

            session.SearcherMock.FakeSearchTimeMs = 10000;

            using (WuApiController wu = new WuApiController(session, UpdateCollectionFactory, SystemInfo))
            {
                wu.BeginSearchUpdates();
                Assert.AreEqual(WuStateId.SearchFailed, wu.AbortSearchUpdates());
                Assert.AreEqual(WuStateId.SearchFailed, wu.GetWuStatus().StateId);
            }
        }
Exemple #2
0
        public void Should_UpdateSetProgressDescription_When_BeginSearch()
        {
            UpdateSessionFake session = new UpdateSessionFake(true);
            UpdateFake        update  = new UpdateFake("update1", true);

            session.SearcherMock.FakeSearchResult = CommonMocks.GetSearchResult(ToUpdateCollection(update));
            session.SearcherMock.FakeSearchTimeMs = 10000;

            using (WuApiController wu = new WuApiController(session, UpdateCollectionFactory, SystemInfo))
            {
                wu.BeginSearchUpdates();
                Assert.IsNotNull(wu.GetWuStatus().Progress);
                Assert.IsNull(wu.GetWuStatus().Progress.Count);
                wu.AbortSearchUpdates();
            }
        }