public void Test_Get_SingleAlarms_BasicParameters(int eNodebId, string details, string happenedTime, string begin, string end, bool matched) { _repository.MockAlarms(new List <AlarmStat> { new AlarmStat { ENodebId = eNodebId, Details = details, HappenTime = DateTime.Parse(happenedTime) } }); var views = _service.Get(eNodebId, DateTime.Parse(begin), DateTime.Parse(end)); var count = _service.GetCounts(eNodebId, DateTime.Parse(begin), DateTime.Parse(end)); if (matched) { Assert.AreEqual(views.Count(), 1); Assert.AreEqual(count, 1); views.ElementAt(0).AssertBasicParameters(eNodebId, details); } else { Assert.AreEqual(views.Count(), 0); Assert.AreEqual(count, 0); } }
public void Test_Get_SingleAlarms_BasicParameters(int eNodebId, string details, string happenedTime, string begin, string end, bool matched) { _repository.MockQueryItems(new List <AlarmStat> { new AlarmStat { ENodebId = eNodebId, Details = details, HappenTime = DateTime.Parse(happenedTime) } }.AsQueryable()); var views = _service.Get(eNodebId, DateTime.Parse(begin), DateTime.Parse(end)); views.Count().ShouldBe(matched ? 1 : 0); var count = _service.GetCounts(eNodebId, DateTime.Parse(begin), DateTime.Parse(end)); count.ShouldBe(matched ? 1 : 0); if (matched) { views.ElementAt(0).AssertBasicParameters(eNodebId, details); } }
public Tuple <int, int> Get(int eNodebId, DateTime begin, DateTime end, int index) { return(new Tuple <int, int>(index, _service.GetCounts(eNodebId, begin, end))); }