public void ArticleLocationXmlTest() { ArticleLocation locations = new ArticleLocation(); XmlDocument xml = Serializer.SerializeToXml(locations); Assert.IsNotNull(xml.SelectSingleNode("ARTICLELOCATION")); }
public void GetCacheKeyTest() { var locations = new ArticleLocation(); string expected = string.Format("{0}|0|0|0|0|True|0|", typeof(ArticleLocation).AssemblyQualifiedName); string actual = locations.GetCacheKey(0, 0, 0, 0, true, 0); Assert.AreEqual(expected, actual); }
/// <summary> /// Returns a test ArticleLocation /// </summary> /// <returns></returns> public static ArticleLocation CreateTestArticleLocation() { var locations = new ArticleLocation() { Locations = new List<Location> { LocationTest.CreateLocation() } }; return locations; }
public void IsUpToDate_ArticleLocationOutOfDate_ReturnsCorrect() { // PREPARE THE TEST // setup the default mocks MockRepository mocks = new MockRepository(); var target = new ArticleLocation() { Locations = new List<Location> { LocationTest.CreateLocation()} }; 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)); }