Skip to content

Commit a24cc6d

Browse files
committed
feat: add unit test for DependencyRelation.Equals method in CodeAnalyzerTests
1 parent 25c7ed6 commit a24cc6d

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

CodeLineCounter.Tests/CodeAnalyzerTests.cs

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using CodeLineCounter.Models;
12
using CodeLineCounter.Services;
23
using CodeLineCounter.Utils;
34

@@ -78,10 +79,28 @@ public void AnalyzeSourceCode_Should_Set_FileCyclomaticComplexity()
7879
};
7980

8081
// Act
81-
CodeMetricsAnalyzer.AnalyzeSourceCode(projectNamespaceMetrics, lines, out _, out _, out int fileCyclomaticComplexity);
82+
CodeMetricsAnalyzer.AnalyzeSourceCode(projectNamespaceMetrics, lines, out _, out _, out int fileCyclomaticComplexity);
8283

8384
// Assert
8485
Assert.Equal(1, fileCyclomaticComplexity);
8586
}
87+
88+
[Fact]
89+
public void DependencyRelation_equals_returns_false_for_different_type()
90+
{
91+
var relation = new DependencyRelation
92+
{
93+
SourceClass = "Class1",
94+
SourceNamespace = "Namespace1",
95+
SourceAssembly = "Assembly1",
96+
TargetClass = "Class2",
97+
TargetNamespace = "Namespace2",
98+
TargetAssembly = "Assembly2",
99+
FilePath = "path/to/file",
100+
StartLine = 1
101+
};
102+
103+
Assert.False(relation.Equals("not a dependency relation"));
104+
}
86105
}
87106
}

0 commit comments

Comments
 (0)