public void SoloGuideEntriesXmlTest() { SoloGuideEntries soloGuideEntries = new SoloGuideEntries(); XmlDocument xml = Serializer.SerializeToXml(soloGuideEntries); Assert.IsNotNull(xml.SelectSingleNode("SOLOGUIDEENTRIES")); }
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); }
/// <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; }
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)); }