Example #1
0
        public void CanNotCloneOtherUsersItem()
        {
            var helper = new EntityHelper <Link>();

            Auth.Init(new AuthWin("Admin", new UserPrincipal(1, "johndoe", "User", "Custom", true)));

            var entity = EntityRegistration.GetService <Link>().First(null);
            var result = helper.Clone(entity.Id);

            Assert.AreEqual(result.Success, false);
            Assert.IsNotNull(result.Item);
            Assert.AreEqual(result.IsAvailable, true);
            Assert.AreEqual(result.IsAuthorized, false);
        }