public void Equals_WhenObjectBatchHasSameKey_ReturnsTrue() { var commitTimeStamp0 = DateTime.UtcNow; var commitItem0 = TestUtility.CreateCatalogCommitItem(commitTimeStamp0, _packageIdentity); var commitItemBatch0 = new CatalogCommitItemBatch(new[] { commitItem0 }, _packageIdentity.Id); var commitItemBatchTask0 = new CatalogCommitItemBatchTask(commitItemBatch0, Task.CompletedTask); var commitTimeStamp1 = commitTimeStamp0.AddMinutes(1); var commitItem1 = TestUtility.CreateCatalogCommitItem(commitTimeStamp1, _packageIdentity); var commitItemBatch1 = new CatalogCommitItemBatch(new[] { commitItem1 }, _packageIdentity.Id); var commitItemBatchTask1 = new CatalogCommitItemBatchTask(commitItemBatch1, Task.CompletedTask); Assert.True(commitItemBatchTask0.Equals(obj: commitItemBatchTask1)); Assert.True(commitItemBatchTask1.Equals(obj: commitItemBatchTask0)); Assert.True(commitItemBatchTask0.Equals(other: commitItemBatchTask1)); Assert.True(commitItemBatchTask1.Equals(other: commitItemBatchTask0)); }
public void Equals_WhenObjectBatchHasDifferentKey_ReturnsFalse() { var commitTimeStamp0 = DateTime.UtcNow; var commitItem0 = TestUtility.CreateCatalogCommitItem( commitTimeStamp0, new PackageIdentity(id: "a", version: new NuGetVersion("1.0.0"))); var commitItemBatch0 = new CatalogCommitItemBatch(new[] { commitItem0 }, key: "a"); var commitItemBatchTask0 = new CatalogCommitItemBatchTask(commitItemBatch0, Task.CompletedTask); var commitTimeStamp1 = commitTimeStamp0.AddMinutes(1); var commitItem1 = TestUtility.CreateCatalogCommitItem( commitTimeStamp1, new PackageIdentity(id: "b", version: new NuGetVersion("1.0.0"))); var commitItemBatch1 = new CatalogCommitItemBatch(new[] { commitItem1 }, key: "b"); var commitItemBatchTask1 = new CatalogCommitItemBatchTask(commitItemBatch1, Task.CompletedTask); Assert.False(commitItemBatchTask0.Equals(obj: commitItemBatchTask1)); Assert.False(commitItemBatchTask1.Equals(obj: commitItemBatchTask0)); Assert.False(commitItemBatchTask0.Equals(other: commitItemBatchTask1)); Assert.False(commitItemBatchTask1.Equals(other: commitItemBatchTask0)); }
public void Equals_WhenObjectIsNull_ReturnsFalse() { Assert.False(_commitItemBatchTask.Equals(obj: null)); Assert.False(_commitItemBatchTask.Equals(other: null)); }