[Test] public void SeveralResTypeChosenForTab() { IResource condition = _registry.RecreateStandardCondition( "Today", "Today", null, "Date", ConditionOp.InRange, "Today", "+1" ); IResource today = _registry.RegisterView( "Today", new IResource[ 1 ]{ condition }, null ); _engine.InitializeCriteria(); //Console.WriteLine( "After view is initialized: " + _unreads.GetUnreadCount( today ) + " + " + _unreads.GetPersistentUnreadCount( today ) ); Assert.AreEqual( 3, Core.UnreadManager.GetUnreadCount( today ) ); _mockResourceTabProvider.SetResourceTab( "Email", "MyTab" ); _mockResourceTabProvider.SetResourceTab( "RSSFeed", "MyTab" ); UnreadState myTabState = _unreads.SetUnreadState( "MyTab", null ); /* _registry.UpdateCountersOnTab( new string[2] { "Email", "RSSFeed" } ); Console.WriteLine( "After Tab is set to Email and RSSFed: " + _unreads.GetUnreadCount( today ) + " + " + _unreads.GetPersistentUnreadCount( today ) ); */ Assert.AreEqual( 2, myTabState.GetUnreadCount( today ) ); Console.WriteLine( "(AUX): " + _unreads.GetUnreadCount( today ) + " + " + _unreads.GetPersistentUnreadCount( today ) ); /* _registry.UpdateCountersOnTab( null ); Console.WriteLine( _unreads.GetUnreadCount( today ) + " + " + _unreads.GetPersistentUnreadCount( today ) ); Assert.AreEqual( 3, _unreads.GetUnreadCount( today ) ); _registry.UpdateCountersOnTab( new string[2] { "Email", "NewsArticle" } ); Assert.AreEqual( 2, _unreads.GetUnreadCount( today ) ); */ }
[Test] public void SimpleTest() { IResource email = _storage.NewResource("Email"); email.AddLink(_propFolder, _folder); Assert.AreEqual(0, _unreadManager.GetUnreadCount(_folder)); email.SetProp(_propUnread, true); Assert.AreEqual(1, _unreadManager.GetUnreadCount(_folder)); email.SetProp(_propSize, 100); Assert.AreEqual(1, _unreadManager.GetUnreadCount(_folder)); email.SetProp(_propUnread, false); Assert.AreEqual(0, _unreadManager.GetUnreadCount(_folder)); }