public void TestImportNewData() { TestSuite.CleanTestDb(); var importInstance = new DepartmentMigration(); importInstance.ImportNewData(); var departBll = new DepartInfoBll(); var departs = departBll.QueryAll().ToList(); departs.Should().HaveCount(37, "because the table 'Y_JCYY_BASEDEPARTMENT' in oracle has 37 rows."); //departs.Should().Contain(depart => depart.DepartmentName == "集宁机务段"); var jnDepot = departs.Find(d => d.DepartmentName == "集宁机务段"); jnDepot.Should().NotBeNull(); jnDepot?.DepartmentName.Should().NotBeNullOrEmpty().And.Be("集宁机务段"); jnDepot?.ParentId.Should().Be(0); var jnyyc = departs.Find(d => d.DepartmentName == "集宁运用车间"); jnyyc.Should().NotBeNull(); jnyyc?.ParentId.Should().Be(jnDepot?.Id); var dbupdateLogBll = new DbUpdateLogBll(); var dbupdateLogs = dbupdateLogBll.QueryList($"TableName='{nameof(DepartInfo)}'").ToList(); dbupdateLogs.Should().HaveCount(37); var relationBll = new PrimaryIdRelationBll(); var relations = relationBll.QueryAll().ToList(); relations.Should().HaveCount(37); var maxBll = new OracleTableMaxIdBll(); var maxIdModel = maxBll.QuerySingle($"TableName='Y_JCYY_BASEDEPARTMENT'"); maxIdModel.Should().NotBeNull(); maxIdModel.MaxId.Should().Be("404100000"); }
private List <DbUpdateLog> GetDbLog(int start) { var logBll = new DbUpdateLogBll(); return(logBll.QueryList($"Id>${start}") as List <DbUpdateLog>); }
public ApiReturns Check(int start) { var list = _logBll.QueryList(d => d.Id > start); return(ApiReturns.Ok(list)); }