Example #1
0
        public void Test_UserAvatar_FullPath()
        {
            var avatar = new UserAvatar
            {
                FilePath = "directory",
                FileDiskName = "test.zip"
            };

            Assert.AreEqual("directory/test.zip", avatar.FullPath);
        }
 public void Update(UserAvatar entity)
 {
 }
 public bool RemoveFromUserOnMatch(User user, UserAvatar avatar)
 {
     return true;
 }
 public void Insert(UserAvatar avatar, HttpPostedFileBase file)
 {
 }
 public void Insert(UserAvatar entity)
 {
 }
 public void Delete(UserAvatar entity)
 {
 }
 public void AssignToUser(User user, UserAvatar avatar)
 {
 }
        public void Test_UserAvatarServiceTest_Insert()
        {
            var avatar = new UserAvatar();

            this.UserAvatarService.Insert(avatar, this.Source);

            Assert.AreEqual(1, avatar.UserId, "UserId");
            Assert.AreEqual("test.jpg", avatar.FileName, "FileName");
            Assert.AreEqual("test2.jpg", avatar.FileDiskName, "FileDiskName");
            Assert.AreEqual("test3", avatar.FileType, "FileType");
            Assert.AreEqual(_path, avatar.FilePath, "FilePath");
        }
        public void Test_UserAvatarServiceTest_RemoveFromUserOnMatch()
        {
            var user = new User();
            var avatar = new UserAvatar { Id = 1, FileName = "test" };

            user.Avatar = avatar;

            var matched = this.UserAvatarService.RemoveFromUserOnMatch(user, avatar);

            Assert.IsTrue(matched, "Matched");
            Assert.IsNull(user.Avatar, "Avatar");
        }