示例#1
0
        [InlineData("win-x86-commandline", "v3.5.0", "nuget.exe", "win-x64-commandline", "v3.5.0", "nuget.exe", false)]  // different tool id
        public void ComparesToolsDimensionsCorrectly(string toolId1, string toolVersion1, string fileName1,
                                                     string toolId2, string toolVersion2, string fileName2, bool expectedResult)
        {
            var tool1 = new ToolDimension(toolId1, toolVersion1, fileName1);
            var tool2 = new ToolDimension(toolId2, toolVersion2, fileName2);

            //Act
            var actualResultEquals      = tool1.Equals(tool2);
            var actualResultGetHashCode = tool1.GetHashCode() == tool2.GetHashCode();

            // Assert
            Assert.Equal(expectedResult, actualResultEquals);
            Assert.Equal(expectedResult, actualResultGetHashCode);
        }
示例#2
0
 protected bool Equals(ToolDimension other)
 {
     return(string.Equals(ToolId, other.ToolId) && string.Equals(ToolVersion, other.ToolVersion) && string.Equals(FileName, other.FileName));
 }
示例#3
0
 protected bool Equals(ToolDimension other)
 {
     return string.Equals(ToolId, other.ToolId) && string.Equals(ToolVersion, other.ToolVersion) && string.Equals(FileName, other.FileName);
 }