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); }
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; }
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; }
public ObjectMetadataRecord(long id, string versionId, DateTime lastModified, AuthorInfo authorInfo) { _authorInfo = authorInfo; _versionedObjectDescriptor = new VersionedObjectDescriptor <long>(id, versionId, lastModified); }