Exemple #1
0
        public void AddDataset(ObjectClassMock dataset)
        {
            if (_datasets == null)
            {
                _datasets = new Dictionary <string, IDataset>();
            }

            _datasets.Add(((IDataset)dataset).Name, dataset);
            dataset.SetWorkspace(this);
        }
Exemple #2
0
        internal ObjectMock(int oid, [NotNull] ObjectClassMock objectClassMock)
        {
            OID = oid;
            _objectClassMock = objectClassMock;

            int oidFieldIndex = _objectClassMock.FindField(_objectClassMock.OIDFieldName);

            if (oidFieldIndex >= 0)
            {
                set_Value(oidFieldIndex, oid);
            }
        }
Exemple #3
0
        public bool Equals(IObjectClass other)
        {
            if (other == null)
            {
                return(false);
            }

            ObjectClassMock otherMock = other as ObjectClassMock;

            if (otherMock != null && otherMock._workspaceMock == _workspaceMock)
            {
                // Allow both workspaces to be null and hence equal!
                return(ObjectClassID == other.ObjectClassID);
            }

            return(ObjectClassID == other.ObjectClassID &&
                   WorkspaceUtils.IsSameWorkspace(_workspaceMock, ((IDataset)other).Workspace,
                                                  WorkspaceComparison.Exact));
        }
Exemple #4
0
 protected bool Equals(ObjectClassMock other)
 {
     return(Equals(_workspaceMock, other._workspaceMock) &&
            ObjectClassID == other.ObjectClassID);
 }