コード例 #1
0
        public void ShouldCheckEqualityOfVersionedObject()
        {
            var descriptorOne = new VersionedObjectDescriptor <long>(1L, null, DateTime.MinValue);
            var descriptorTwo = new VersionedObjectDescriptor <long>(descriptorOne.Id, descriptorOne.VersionId, DateTime.MaxValue);

            Assert.True(Equals(descriptorOne, descriptorTwo));
            Assert.True(Equals(descriptorTwo, descriptorOne));
            Assert.Equal(descriptorOne, descriptorOne);
            Assert.Equal(descriptorTwo, descriptorTwo);
            Assert.Equal(descriptorOne, descriptorTwo);
            Assert.Equal(descriptorTwo, descriptorOne);

            descriptorOne = new VersionedObjectDescriptor <long>(2L, "version", DateTime.MinValue);
            Assert.Equal(descriptorOne, descriptorOne);
            Assert.NotEqual(descriptorOne, descriptorTwo);
            Assert.NotEqual(descriptorTwo, descriptorOne);
            Assert.False(Equals(descriptorOne, descriptorTwo));
            Assert.False(Equals(descriptorTwo, descriptorOne));

            descriptorTwo = new VersionedObjectDescriptor <long>(descriptorOne.Id, descriptorOne.VersionId.ToUpper(), DateTime.MaxValue);
            Assert.True(Equals(descriptorOne, descriptorTwo));
            Assert.True(Equals(descriptorTwo, descriptorOne));
            Assert.Equal(descriptorTwo, descriptorTwo);
            Assert.Equal(descriptorOne, descriptorTwo);
            Assert.Equal(descriptorTwo, descriptorOne);
        }
コード例 #2
0
 internal ObjectVersionMetadataRecord(
     long id,
     string versionId,
     int versionIndex,
     DateTime lastModified,
     AuthorInfo authorInfo,
     JObject properties,
     IReadOnlyCollection <int> modifiedElements)
 {
     _authorInfo = authorInfo;
     _versionedObjectDescriptor = new VersionedObjectDescriptor <long>(id, versionId, lastModified);
     VersionIndex     = versionIndex;
     Properties       = properties;
     ModifiedElements = modifiedElements;
 }
コード例 #3
0
 public TemplateVersionRecord(
     long id,
     string versionId,
     int versionIndex,
     DateTime lastModified,
     AuthorInfo authorInfo,
     JObject properties,
     IReadOnlyCollection <int> elementTemplateCodes)
 {
     _authorInfo = authorInfo;
     _versionedObjectDescriptor = new VersionedObjectDescriptor <long>(id, versionId, lastModified);
     VersionIndex         = versionIndex;
     Properties           = properties;
     ElementTemplateCodes = elementTemplateCodes;
 }
コード例 #4
0
 public ObjectMetadataRecord(long id, string versionId, DateTime lastModified, AuthorInfo authorInfo)
 {
     _authorInfo = authorInfo;
     _versionedObjectDescriptor = new VersionedObjectDescriptor <long>(id, versionId, lastModified);
 }