public void AddPermission_WhenDuplicatePermissionsArePassed_ReturnsFalse()
        {
            Address address = this.addressFactory.CreateAddress();
            var     acl     = new AccessControlList();

            acl.AddPermission(address, SetFavoriteNumberAction.Type, address);
            Assert.False(acl.AddPermission(address, SetFavoriteNumberAction.Type, address));
        }
        public void UpdatePermissionSender_WhenPermissionExists_ReturnsTrue()
        {
            var address    = this.addressFactory.CreateAddress();
            var newAddress = this.addressFactory.CreateAddress();
            var acl        = new AccessControlList();

            Assert.True(acl.AddPermission(address, SetFavoriteNumberAction.Type, null));

            Assert.True(acl.AddPermission(newAddress, SetFavoriteNumberAction.Type, null));
            Assert.True(acl.HasPermission(address, SetFavoriteNumberAction.Type, this.addressFactory.CreateAddress()));
            Assert.True(acl.HasPermission(newAddress, SetFavoriteNumberAction.Type, this.addressFactory.CreateAddress()));
        }
        public void HasPermission_WhenGrantedWithHashSet_ReturnsTrue()
        {
            Address address = this.addressFactory.CreateAddress();
            var     acl     = new AccessControlList();

            Assert.True(acl.AddPermission(address, SetFavoriteNumberAction.Type, null));
            Assert.True(acl.HasPermission(address, SetFavoriteNumberAction.Type, address));
        }
        public void HasPermission_WhenPermissionHasBeenAdded_ReturnsTrue()
        {
            Address address = this.addressFactory.CreateAddress();
            var     acl     = new AccessControlList();

            acl.AddPermission(address, SetFavoriteNumberAction.Type, address);
            Assert.True(acl.HasPermission(address, SetFavoriteNumberAction.Type, address));
        }
        public void AddPermission_WithWildCard_ReturnsTrue()
        {
            var acl = new AccessControlList();

            Assert.True(acl.AddPermission(null, SetFavoriteNumberAction.Type, null));
        }
        public void AddPermission_WhenNullIsPassed_ReturnsTrue()
        {
            var acl = new AccessControlList();

            Assert.True(acl.AddPermission(null, null, null));
        }