Esempio n. 1
0
        public void Name_Is_Truncated()
        {
            var user = new UserInfo { Name = new string('z', 255) };
            Assert.That(user.Name.Length, Is.EqualTo(254));

            user.Name = new string('z', 1000);
            Assert.That(user.Name.Length, Is.EqualTo(254));

            user.Name = new string('z', 254);
            Assert.That(user.Name.Length, Is.EqualTo(254));
        }
Esempio n. 2
0
        public void Location_Is_Truncated()
        {
            var user = new UserInfo {Location = new string('z', 255)};
            Assert.That(user.Location.Length, Is.EqualTo(254));

            user.Location = new string('z', 1000);
            Assert.That(user.Location.Length, Is.EqualTo(254));

            user.Location = new string('z', 254);
            Assert.That(user.Location.Length, Is.EqualTo(254));
        }
Esempio n. 3
0
        public void WriteUserInfo(UserInfo info)
        {
            using (var conn = ConnectionFactory.Create())
            {
                conn.Open();
                using(var cmd = new SqlCommand("AddTwitterUser", conn))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@username", info.Name);
                    cmd.Parameters.AddWithValue("@location", info.Location);
                    cmd.Parameters.AddWithValue("@friendCount", info.FriendCount);
                    cmd.Parameters.AddWithValue("@followerCount", info.FollowerCount);

                    cmd.ExecuteNonQuery();
                }
            }
        }
Esempio n. 4
0
 public UserInfoResponse(UserInfo userInfo)
 {
     UserInfo = userInfo;
 }
Esempio n. 5
0
 public void Name_Is_Null()
 {
     var user = new UserInfo { Name = null };
     Assert.That(user.Name, Is.Null);
 }
Esempio n. 6
0
 public void Name_Is_Normal()
 {
     var user = new UserInfo { Name = "normal" };
     Assert.That(user.Name, Is.EqualTo("normal"));
 }
Esempio n. 7
0
 public void Name_Is_Empty()
 {
     var user = new UserInfo { Name = string.Empty };
     Assert.That(user.Name, Is.EqualTo(string.Empty));
 }
Esempio n. 8
0
 public void Location_Is_Null()
 {
     var user = new UserInfo {Location = null};
     Assert.That(user.Location, Is.Null);
 }
Esempio n. 9
0
 public void Location_Is_Normal()
 {
     var user = new UserInfo { Location = "normal"};
     Assert.That(user.Location, Is.EqualTo("normal"));
 }
Esempio n. 10
0
 public void Location_Is_Empty()
 {
     var user = new UserInfo {Location = string.Empty};
     Assert.That(user.Location, Is.EqualTo(string.Empty));
 }