示例#1
0
            public void SetsCorrectValues(int id, string name, string category, string keyId, byte group,
                                          byte[] permissionBytes)
            {
                var userInfo = new TmUserInfo(id, name, category, keyId, group, permissionBytes);

                userInfo.Id.Should().Be(id);
                userInfo.Name.Should().Be(name);
                userInfo.KeyId.Should().Be(keyId);
                userInfo.GroupId.Should().Be(group);
            }
        public void InitializeTmWithoutSql(int tmCid, TmUserInfo userInfo, TmServerFeatures features)
        {
            TmCid            = tmCid;
            TmUserInfo       = userInfo;
            TmServerFeatures = features;

            OikDataApi.SetUserInfoAndServerFeatures(TmUserInfo, TmServerFeatures);
            TmsApi.SetCidAndUserInfo(TmCid, TmUserInfo);
            ServerService.SetTmCid(TmCid);

            ServerService.CheckSqlConnection = false;
            OikDataApi.IsSqlAllowed          = false;
        }
        public void InitializeTm(int tmCid, int rbCid, int rbPort, TmUserInfo userInfo, TmServerFeatures features)
        {
            TmCid            = tmCid;
            RbCid            = rbCid;
            RbPort           = rbPort;
            TmUserInfo       = userInfo;
            TmServerFeatures = features;

            OikSqlApi.SetCreateOikSqlConnection(CreateOikSqlConnection);
            ServerService.SetCreateOikSqlConnection(CreateOikSqlConnection);

            OikDataApi.SetUserInfoAndServerFeatures(TmUserInfo, TmServerFeatures);
            TmsApi.SetCidAndUserInfo(TmCid, TmUserInfo);
            ServerService.SetTmCid(TmCid);
        }
示例#4
0
            public void ReturnsCorrectValues(byte[]            permissionBytes,
                                             TmUserPermissions permission,
                                             bool expected,
                                             int id,
                                             string name,
                                             string category,
                                             string keyId,
                                             byte group)
            {
                var userInfo = new TmUserInfo(id, name, category, keyId, group, permissionBytes);

                var result = userInfo.HasAccess(permission);

                result.Should().Be(expected);
            }