public void UserSubscriptionsListXmlTest() { UserSubscriptionsList userSubscriptions = new UserSubscriptionsList(); XmlDocument xml = Serializer.SerializeToXml(userSubscriptions); Assert.IsNotNull(xml.SelectSingleNode("USERSUBSCRIPTIONSLIST")); }
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); }
/// <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; }
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)); }