public void IsSuccessDeleteData() { IEnumerable <SignPointActivityDto> actIdList = _signPointActivityRepository.Query <SignPointActivityDto>("select top 2 * from SignPointActivity"); //数据库应该有数据 actIdList.ShouldNotBeNull(); //条目不为空 actIdList.Any().ShouldBe(true); foreach (var act in actIdList) { var watch = new Stopwatch(); watch.Start(); _actuatorAppService.StartWorkFor(act.Id); _actuatorAppService.StartWorkFor(act.Id); ; _signActivityRepository.Count(t => t.ActID == act.ActID.ToString()).ShouldBe(1); watch.Stop(); watch.ElapsedMilliseconds.ShouldBeLessThan(10000); } foreach (var act in actIdList) { _actuatorAppService.DeleteActData(act.Id, act.ActID.ToString()); } //重置缓存 _redisHelper.KeyDelete(SUCCESSACTIDQUEUEKEY); _redisHelper.StringGet(SUCCESSACTIDQUEUEKEY).ShouldBe(null); }
public JsonResult TestMongodb() { try { var count = _signActivityRepository.Count(); Console.WriteLine("all count" + count); return(Json(count)); } catch (Exception e) { throw new Exception("Mongodb ===>" + DocumentConfigurage.ConnectionString + " ex" + e.ToString()); } }