예제 #1
0
        public void UserSubscriptionsListXmlTest()
        {
            UserSubscriptionsList userSubscriptions = new UserSubscriptionsList();
            XmlDocument xml = Serializer.SerializeToXml(userSubscriptions);

            Assert.IsNotNull(xml.SelectSingleNode("USERSUBSCRIPTIONSLIST"));

        }
예제 #2
0
 public void GetCacheKeyTest()
 {
     var userSubscriptions = new UserSubscriptionsList();
     string expected = string.Format("{0}|0|0|0|0|True|0|", typeof(UserSubscriptionsList).AssemblyQualifiedName);
     string actual = userSubscriptions.GetCacheKey(0, 0, 0, 0, true, 0);
     Assert.AreEqual(expected, actual);
 }
예제 #3
0
 /// <summary>
 /// Returns a test UserSubscriptionsList
 /// </summary>
 /// <returns></returns>
 public static UserSubscriptionsList CreateTestUserSubscriptionsList()
 {
     var userSubscriptions = new UserSubscriptionsList()
     {
         Users = new List<UserElement> { new UserElement() { user = UserTest.CreateTestUser() } }
     };
     return userSubscriptions;
 }
예제 #4
0
        public void IsUpToDate_UserSubscriptionsListOutOfDate_ReturnsCorrect()
        {
            // PREPARE THE TEST
            // setup the default mocks
            MockRepository mocks = new MockRepository();

            var target = new UserSubscriptionsList()
            {
                Users = new List<UserElement> { new UserElement() { user = UserTest.CreateTestUser() } }
            };

            var reader = mocks.DynamicMock<IDnaDataReader>();
            reader.Stub(x => x.HasRows).Return(true);
            reader.Stub(x => x.Read()).Return(false);

            var creator = mocks.DynamicMock<IDnaDataReaderCreator>();
            mocks.ReplayAll();

            Assert.AreEqual(false, target.IsUpToDate(creator));
        }