예제 #1
0
        public void LinkSubscriptionsListXmlTest()
        {
            LinkSubscriptionsList linkSubscriptions = new LinkSubscriptionsList();
            XmlDocument xml = Serializer.SerializeToXml(linkSubscriptions);

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

        }
예제 #2
0
 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);
 }
예제 #3
0
 /// <summary>
 /// Returns a test LinkSubscriptionsList
 /// </summary>
 /// <returns></returns>
 public static LinkSubscriptionsList CreateTestLinkSubscriptionsList()
 {
     var linkSubscriptions = new LinkSubscriptionsList()
     {
         Links = new List<Link> { LinkTest.CreateLink() }
     };
     return linkSubscriptions;
 }
예제 #4
0
        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));
        }