Exemplo n.º 1
0
        public void SoloGuideEntriesXmlTest()
        {
            SoloGuideEntries soloGuideEntries = new SoloGuideEntries();
            XmlDocument xml = Serializer.SerializeToXml(soloGuideEntries);

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

        }
Exemplo n.º 2
0
 public void GetCacheKeyTest()
 {
     var soloGuideEntries = new SoloGuideEntries();
     string expected = string.Format("{0}|0|0|0|0|True|0|", typeof(SoloGuideEntries).AssemblyQualifiedName);
     string actual = soloGuideEntries.GetCacheKey(0, 0, 0, 0, true, 0);
     Assert.AreEqual(expected, actual);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Returns a test SoloGuideEntries
 /// </summary>
 /// <returns></returns>
 public static SoloGuideEntries CreateTestSoloGuideEntries()
 {
     var soloGuideEntries = new SoloGuideEntries()
     {
         SoloUsers = new List<SoloGuideEntries.SoloUser> 
         { 
             new SoloGuideEntries.SoloUser() 
             { User = new UserElement () { user = UserTest.CreateTestUser() },
               Count = 1
             }
         }
     };
     return soloGuideEntries;
 }
Exemplo n.º 4
0
        public void IsUpToDate_SoloGuideEntriesOutOfDate_ReturnsCorrect()
        {
            // PREPARE THE TEST
            // setup the default mocks
            MockRepository mocks = new MockRepository();

            var target = new SoloGuideEntries()
            {
                SoloUsers = new List<SoloGuideEntries.SoloUser> 
                { 
                    new SoloGuideEntries.SoloUser() 
                    { User = new UserElement () { user = UserTest.CreateTestUser() },
                      Count = 1
                    }
                }
            };

            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));
        }