public void LinkSubscriptionsListXmlTest() { LinkSubscriptionsList linkSubscriptions = new LinkSubscriptionsList(); XmlDocument xml = Serializer.SerializeToXml(linkSubscriptions); Assert.IsNotNull(xml.SelectSingleNode("LINKSUBSCRIPTIONSLIST")); }
public void GetCacheKeyTest() { var linkSubscriptions = new LinkSubscriptionsList(); string expected = string.Format("{0}|0|0|0|0|True|0|", typeof(LinkSubscriptionsList).AssemblyQualifiedName); string actual = linkSubscriptions.GetCacheKey(0, 0, 0, 0, true, 0); Assert.AreEqual(expected, actual); }
/// <summary> /// Returns a test LinkSubscriptionsList /// </summary> /// <returns></returns> public static LinkSubscriptionsList CreateTestLinkSubscriptionsList() { var linkSubscriptions = new LinkSubscriptionsList() { Links = new List<Link> { LinkTest.CreateLink() } }; return linkSubscriptions; }
public void IsUpToDate_LinkSubscriptionsListOutOfDate_ReturnsCorrect() { // PREPARE THE TEST // setup the default mocks MockRepository mocks = new MockRepository(); var target = new LinkSubscriptionsList() { Links = new List<Link> { LinkTest.CreateLink() } }; 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)); }