Ejemplo n.º 1
0
        public void TestMenuGetList()
        {
            IEnumerable <MenuEntity> result = DALCore.GetInstance().SystemCore.MenuGetList <MenuEntity>(null);

            Debug.WriteLine(result);
            Assert.AreNotEqual(result, null);
        }
Ejemplo n.º 2
0
        public void TestTaskUpdateJudge()
        {
            Dictionary <string, object> paras = new Dictionary <string, object>();

            paras["TaskId"]   = "50e6d5bc11686281";
            paras["userName"] = "******";
            bool result = DALCore.GetInstance().TaskCore.TaskUpdateJudge(paras);

            Assert.AreEqual(result, true);
        }
Ejemplo n.º 3
0
        public void TestQryRealName()
        {
            Dictionary <string, object> paras = new Dictionary <string, object>();

            string[] strs = { "admin", "zxy" };
            paras["names"] = strs;
            var users = DALCore.GetInstance().UserCore.QryRealName <UserEntity>(paras).ToList();

            Assert.AreNotEqual(users.Count, 0);
        }
Ejemplo n.º 4
0
        public void TestTaskInsertJudge()
        {
            Dictionary <string, object> paras = new Dictionary <string, object>();

            paras["ProductId"] = "4adf5dfe42afa";
            paras["userName"]  = "******";
            bool result = DALCore.GetInstance().TaskCore.TaskInsertJudge(paras);

            Assert.AreEqual(result, true);
        }
Ejemplo n.º 5
0
        public void TestRoleDelete()
        {
            Dictionary <string, object> pars = new Dictionary <string, object>();

            pars["id"] = 1007;
            int result = DALCore.GetInstance().SystemCore.RoleDelete(pars);

            // 0成功 1角色不存在 2角色被用户引用
            Console.WriteLine(result);
            Assert.AreEqual(result, 0);
        }
Ejemplo n.º 6
0
        public void TestMethod1()
        {
            var paras = new Dictionary <string, object>();

            paras["pi"]       = 1;
            paras["pageSize"] = 20;
            paras["userid"]   = "admin";
            int iCount   = 0;
            var userList = DALCore.GetInstance().User.QryUsers <UserEntity>(paras, out iCount);

            Assert.AreNotEqual(iCount, 0);
        }
Ejemplo n.º 7
0
        public void TestCheckUseridAndEmail()
        {
            Dictionary <string, object> pars = new Dictionary <string, object>();

            pars["Email"]       = "*****@*****.**";
            pars["AccountName"] = "admin";
            pars["ID"]          = 0;
            int result = DALCore.GetInstance().UserCore.CheckUseridAndEmail(pars);

            Console.WriteLine(result);
            Assert.AreNotEqual(result, 0);
        }
Ejemplo n.º 8
0
        public void TestBatchInsert()
        {
            List <TaskEntity> listTask = new List <TaskEntity>();
            TaskEntity        task     = new TaskEntity();

            task.Name       = "测试任务1";
            task.ProjectId  = "1";
            task.ParentId   = "0";
            task.EndTime    = DateTime.ParseExact("2019-11-11", "yyyy-MM-dd", CultureInfo.CurrentCulture);
            task.Describe   = "测试数据1";
            task.Remarks    = "测试数据1";
            task.Estimate   = decimal.Parse("200");
            task.Consume    = decimal.Parse("0.0");
            task.Sort       = 1;
            task.State      = 1;
            task.Send       = null;
            task.CreateBy   = "zxy";
            task.CreateTime = DateTime.Now;
            List <TeamEntity> listTeam = new List <TeamEntity>();
            TeamEntity        team     = new TeamEntity();

            team.ProjectId = "1";
            team.Person    = "user22";
            listTeam.Add(team);
            task.listTeam = listTeam;
            listTask.Add(task);
            task            = new TaskEntity();
            task.Name       = "测试任务2";
            task.ProjectId  = "1";
            task.ParentId   = "0"; // 不可为空
            task.EndTime    = DateTime.ParseExact("2019-11-11", "yyyy-MM-dd", CultureInfo.CurrentCulture);
            task.Describe   = null;
            task.Remarks    = null;
            task.Estimate   = decimal.Parse("200");
            task.Consume    = decimal.Parse("0.0");
            task.Sort       = 1;
            task.State      = 1;
            task.Send       = "";
            task.CreateBy   = "zxy";
            task.CreateTime = DateTime.Now;
            listTeam        = new List <TeamEntity>();
            team            = new TeamEntity();
            team.ProjectId  = "1";
            team.Person     = "user33";
            listTeam.Add(team);
            task.listTeam = listTeam;
            listTask.Add(task);
            int result = DALCore.GetInstance().TaskCore.BatchInsert(listTask, "zxy");

            Assert.AreNotEqual(result, 0);
        }
Ejemplo n.º 9
0
        public void TestMethod3()
        {
            Dictionary <string, object> pars = new Dictionary <string, object>();

            pars["ID"]         = Guid.NewGuid().To16String();
            pars["Name"]       = "resfsa";
            pars["StartTime"]  = DateTime.Now.ToDate();
            pars["EndTime"]    = DateTime.Now.ToDate();
            pars["Describe"]   = "啊打发撒旦";
            pars["Victors"]    = "1,2";
            pars["CreateBy"]   = "jaydeny";
            pars["CreateTime"] = DateTime.Now.ToDate();
            pars["DutyPerson"] = "J·Y";
            pars["Remarks"]    = "";
            pars["State"]      = 1;
            ProjectEntity     projectEntity = new ProjectEntity();
            List <TeamEntity> teams         = new List <TeamEntity>();

            teams.Add(new TeamEntity()
            {
                ProjectId = pars["ID"].ToString(), TaskId = "0", Person = "user1"
            });
            teams.Add(new TeamEntity()
            {
                ProjectId = pars["ID"].ToString(), TaskId = "0", Person = "user12"
            });
            teams.Add(new TeamEntity()
            {
                ProjectId = pars["ID"].ToString(), TaskId = "0", Person = "user14"
            });
            projectEntity.Teams = teams;
            var dtCheckInfo = new DataTable();

            dtCheckInfo.Columns.Add("ProjectId", typeof(string));
            dtCheckInfo.Columns.Add("TaskId", typeof(string));
            dtCheckInfo.Columns.Add("Person", typeof(string));
            foreach (var item in projectEntity.Teams)
            {
                var row = dtCheckInfo.NewRow();
                row[0] = item.ProjectId;
                row[1] = item.TaskId;
                row[2] = item.Person;
                dtCheckInfo.Rows.Add(row);
            }
            pars["Team"] = dtCheckInfo;
            int rows = DALCore.GetInstance().ProjectCore.Save(pars);

            Assert.AreNotEqual(rows, 1);
        }
Ejemplo n.º 10
0
        public void TestMethod2()
        {
            DynamicParameters pars = new DynamicParameters();

            pars.Add("CreateBy", "admin");
            Pagination pagination = new Pagination();

            pagination.sidx = "ID";
            pagination.sord = "DESC";
            pagination.rows = 10;
            pagination.page = 1;

            var data = new
            {
                rows    = DALCore.GetInstance().ProjectCore.QryProjects <ProjectEntity>(pars, pagination),
                total   = pagination.total,
                page    = pagination.page,
                records = pagination.records
            };

            Assert.AreNotEqual(pagination.records, 0);
        }
Ejemplo n.º 11
0
        public void TestMethod1()
        {
            Dictionary <string, object> pars = new Dictionary <string, object>();

            pars["keyword"] = "Test_";
            Pagination pagination = new Pagination();

            pagination.sidx = "ID";
            pagination.sord = "DESC";
            pagination.rows = 10;
            pagination.page = 1;

            var data = new
            {
                rows    = DALCore.GetInstance().UserCore.QryUsers <UserEntity>(pagination, pars),
                total   = pagination.total,
                page    = pagination.page,
                records = pagination.records
            };

            Assert.AreNotEqual(pagination.records, 0);
        }
Ejemplo n.º 12
0
        public void TestTaskList()
        {
            Dictionary <string, object> pars = new Dictionary <string, object>();

            pars.Add("qryTag", 0);
            pars.Add("userName", "admin");
            Pagination pagination = new Pagination();

            pagination.sidx = "CreateTime";
            pagination.sord = "ASC";
            pagination.rows = 20;
            pagination.page = 1;
            var tasks = DALCore.GetInstance().TaskCore.QryTask <TaskEntity>(pagination, pars).ToList();
            var data  = new
            {
                rows    = tasks,
                total   = pagination.total,
                page    = pagination.page,
                records = pagination.records
            };
            List <string> teams = new List <string>();

            foreach (TaskEntity task in tasks)
            {
                teams.Add(task.ID);
            }
            // 去重复
            teams = teams.Where((x, i) => teams.FindIndex(z => z == x) == i).ToList();
            string strTeams = String.Join("','", teams);

            strTeams = "'" + strTeams + "'";
            // 查询任务团员
            var teamList = DALCore.GetInstance().TeamCore.GetTeams <TeamEntity>(strTeams);

            Assert.AreNotEqual(tasks.Count, 0);
        }
Ejemplo n.º 13
0
        public void TestTaskDelete()
        {
            bool result = DALCore.GetInstance().TaskCore.TaskDelete("45de68f5db7bdba5");

            Assert.AreEqual(result, true);
        }
Ejemplo n.º 14
0
        public void TestSetCharge()
        {
            bool result = DALCore.GetInstance().UserCore.SetCharge(2, "Jason");

            Assert.AreEqual(result, true);
        }
Ejemplo n.º 15
0
        public void TestGetCharge()
        {
            string result = DALCore.GetInstance().UserCore.GetCharge(2);

            Assert.AreNotEqual(result, null);
        }