Beispiel #1
0
        public void AddMember_ParameterEmty_Test()
        {
            SmartHsService service = new SmartHsService();
            var            result  = service.AddMember(string.Empty);

            Assert.AreEqual(JObject.Parse(result)["Code"], 0);
        }
Beispiel #2
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);
        }