Esempio n. 1
0
        public void Login_Test()
        {
            SmartHsService service = new SmartHsService();
            var            result  = service.Login("121212", "121212", "10.26.23.254", 1);

            Assert.AreEqual(JObject.Parse(result)["Code"], 1);
        }
Esempio n. 2
0
        public void AddMember_ParameterEmty_Test()
        {
            SmartHsService service = new SmartHsService();
            var            result  = service.AddMember(string.Empty);

            Assert.AreEqual(JObject.Parse(result)["Code"], 0);
        }
Esempio n. 3
0
        public void GetSpecialPostTest()
        {
            SmartHsService service = new SmartHsService();
            var            result  = service.GetSpecialInteractPost(2);

            Assert.IsTrue(result.JObjCodeTrue());
            Assert.AreNotEqual(result.JObjMessageToken().Count(), 0);
        }
Esempio n. 4
0
        public void GetPostsTest()
        {
            SmartHsService service = new SmartHsService();
            var            result  = service.GetPostsByPage(1, 5);

            Assert.IsTrue(result.JObjCodeTrue());
            Assert.AreNotEqual(result.JObjMessageToken().Count(), 0);
        }
Esempio n. 5
0
        public void PostCountTest()
        {
            SmartHsService service = new SmartHsService();
            var            result  = service.GetPostCount();

            Assert.IsTrue(result.JObjCodeTrue());
            Assert.AreNotEqual(result.JobjMessageConvert <long>(), 0);
        }
Esempio n. 6
0
        public void FindCommunityByStreetTest()
        {
            SmartHsService service   = new SmartHsService();
            var            result    = service.FindCommunityByStreet(3);
            var            community = JsonConvert.DeserializeObject(result);

            Assert.AreEqual(JObject.Parse(result)["Code"], 1);
        }
Esempio n. 7
0
        public void AddSessionVerifyTest()
        {
            SmartHsService service = new SmartHsService();
            var            tick    = DateTime.Now.Ticks;
            var            userKey = "121212";
            var            code    = Guid.NewGuid().ToString();
            var            result  = service.AddSessionVerify(tick, "121212", code);
            var            jobj    = JObject.Parse(result);

            Assert.AreEqual(jobj["Code"], 1);
        }
Esempio n. 8
0
        public void UpdateMember_WithCommunity_Test()
        {
            SmartHsService service = new SmartHsService();
            member         mem     = new member();

            mem.address           = "test update  address";
            mem.default_community = 31;
            mem.phone             = "123000";
            var json   = JsonConvert.SerializeObject(mem, Formatting.None);
            var result = service.UpdateMember(4, json);

            Assert.AreEqual(JObject.Parse(result)["Code"], 1);
        }
Esempio n. 9
0
        public void AddPostTest()
        {
            SmartHsService service = new SmartHsService();
            var            result  = service.AddInteractPost("test post111", "互帮互助test post 内容", "Post 招聘", "手机号:te9090090", 108, 15);

            result = service.AddInteractPost("mCake寻找周末营业员兼职", "本店主要经营和销售蛋糕,面包类食品,牛奶,酸奶等食品。\r\n现急需一名女性营业员,年龄在18-35岁,高中以上学历。本市户口为佳。\r\n时间为周六,周日一天或者两天。上班时间8:30 -- 18:30。\r\n本店为汪弄社区东边,卖鱼路xxx号的MyCake蛋糕店。\r\n待遇面议。", "兼职", "手机:186xxxx9800 。 微信号:mCake2010", 105, 16);
            result = service.AddInteractPost("寻狗启示", "本人于昨日(2014-09-10)丢失。。。", "寻物", "手机号:13655xxxxxx12", 107, 16);
            result = service.AddInteractPost("兼职营业员 ", "本人于急需一名。。。", "兼职", "qq:655xxxxxx12", 107, 16);
            result = service.AddInteractPost("test post111", "互帮互助test post 内容", "Post 招聘", "手机号:te9090090", 108, 15);
            result = service.AddInteractPost("test 222", "互帮互助test post 内容", "Post 招聘", "手机号:te9090090", 108, 15);
            result = service.AddInteractPost("test post123", "互帮互助test post 内容", "招聘", "手机号:te9090090", 108, 15);
            result = service.AddInteractPost("test df标题", "互帮互助test post 内容", "招聘", "手机号:te9090090", 108, 15);
            result = service.AddInteractPost("test post标题", "互帮互助test post 内容", "招聘", "手机号:te9090090", 108, 15);
            Assert.IsTrue(result.JObjCodeTrue());
            Assert.AreNotEqual(result.JobjMessageConvert <long>(), 0);
        }
Esempio n. 10
0
        public void AddMember_WithoutCommunity_Test()
        {
            SmartHsService service = new SmartHsService();
            member         mem     = new member
            {
                address    = "test asd",
                last_ip    = "10.12.12.12",
                last_time  = DateTime.Now,
                last_way   = 1,
                mail       = "*****@*****.**",
                member_key = "user123",
                name       = "user1",
                phone      = "123000"
            };
            var json   = JsonConvert.SerializeObject(mem, Formatting.Indented);
            var result = service.AddMember(json);

            Assert.AreEqual(JObject.Parse(result)["Code"], 1);
        }
Esempio n. 11
0
 public void FindStreetGroupTest()
 {
     SmartHsService service = new SmartHsService();
     var            result  = service.FindStreetGroup();
 }