public void GetAll_will_return_debug_info_ordered_by_created_date_latest_info_first() { //arrange var debug1 = new DebugInfo() { Type = "All", DateCreated = new DateTime(2010, 10, 1) }; var debug2 = new DebugInfo() { Type = "All", DateCreated = new DateTime(2012, 10, 1) }; _debugInfoRepository.Add(debug1); _debugInfoRepository.Add(debug2); var mut = new DebugInfoService(_debugInfoRepository); //act var result = mut.GetAll().ToList(); //assert Assert.AreEqual(new DateTime(2012, 10, 1), result[0].DateCreated); //cleanup _debugInfoRepository.Delete(debug1); _debugInfoRepository.Delete(debug2); }
public void GetAll_will_return_all_type_which_is_not_developer() { //arrange var debug1 = new DebugInfo() { Type = "Developer" }; var debug2 = new DebugInfo() { Type = "All" }; _debugInfoRepository.Add(debug1); _debugInfoRepository.Add(debug2); var mut = new DebugInfoService(_debugInfoRepository); //act var result = mut.GetAll().ToList(); //assert Assert.AreNotEqual("Developer", result[0].Type); //cleanup _debugInfoRepository.Delete(debug1); _debugInfoRepository.Delete(debug2); }