public void TestImportNewData() { var importInstance = new PostMigragion(); importInstance.ImportNewData(); var posts = new PostsBll().QueryAll(); posts.Should() .HaveCount(192, "because there are only 192 rows data in the table j_jcyy_basepost of data source"); var dbUpdateLogs = new DbUpdateLogBll().QueryAll(); dbUpdateLogs.Should().HaveCount(192, "because I just insert 192 rows data to the table Posts"); var relations = new PrimaryIdRelationBll().QueryAll(); relations.Should() .HaveCount(192, "becaust there are only 192 rows data in the table j_jcyy_basepost of data source"); var maxId = new OracleTableMaxIdBll().QuerySingle($"TableName='{nameof(J_JCYY_BASEPOST)}'"); maxId.Should().NotBeNull(); maxId?.MaxId.Should().Be("226"); }
public void TestUpdateEditedData() { var updateInstance = new PostMigragion(); updateInstance.UpdateEditedData(); var editedModel = new PostsBll().QuerySingle("PostName='测试修改安全监控员'"); editedModel.Should().NotBeNull(); var dbUpdateLog = new DbUpdateLogBll().QuerySingle($"TableName='{nameof(Posts)}' AND UpdateType=2"); dbUpdateLog.Should().NotBeNull(); }
public void TestImportNewData() { // 导入员工之前必须先导入部门、岗位 var departImport = new DepartmentMigration(); departImport.ImportNewData(); var postImport = new PostMigragion(); postImport.ImportNewData(); var testInstance = new StaffMigration(); testInstance.ImportNewData(); var totalCount = 7063; var allStaff = new PersonInfoBll().QueryAll().ToList(); allStaff.Should().HaveCount(totalCount, $"because the total count of the data source is {totalCount}"); var single = allStaff.Find(p => p.WorkNo == "2920133"); single.Should().NotBeNull(); single.Name.Should().Be("杨凤山"); single.BirthDate.Should().Be(new DateTime(1960, 12, 1, 12, 0, 0)); single.Password.Should().Be("0133".GetMd5()); var dbLogs = new DbUpdateLogBll().QueryList($"TableName='{nameof(PersonInfo)}'"); dbLogs.Should().HaveCount(totalCount); var relations = new PrimaryIdRelationBll().QueryAll(); relations.Should().HaveCount(totalCount); var maxId = new OracleTableMaxIdBll().QuerySingle($"TableName='{nameof(Z_JCYY_BASEPERSONNEL)}'"); maxId.Should().NotBeNull(); maxId?.MaxId.Should().NotBeNullOrEmpty() .And.Subject.Should().Be("404990019"); }