Skip to content

Commit

Permalink
Merge pull request #11 from Codesee-io/JSON-compatibility
Browse files Browse the repository at this point in the history
Change case on To and From to match Link in domain
  • Loading branch information
mkestler-rtp authored Feb 7, 2023
2 parents 73dc532 + 1825d54 commit a7d5738
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions DotNETDepends/Output/AnalysisOutput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ public class Link
{
public Link(string from, string to)
{
From = from;
To = to;
this.from = from;
this.to = to;
}
public string From { get; set; }
public string To { get; set; }
//When from and to are deserialized by Node, it expects lower case
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Compatibility")]
public string from { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "Compatibility")]
public string to { get; set; }
}

public class AnalysisOutput : IErrorReporter
Expand Down
6 changes: 3 additions & 3 deletions TestDependencyReading/DependencyReaderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ private void AssertLinks(Dictionary<string, string> expected, Link[] found)
{
foreach (var link in found)
{
expected.TryGetValue(link.From, out var expectedTo);
expected.TryGetValue(link.from, out var expectedTo);
Assert.IsNotNull(expectedTo);
Assert.AreEqual(expectedTo, link.To);
Assert.AreEqual(expectedTo, link.to);
}
}

private bool LinkMatches(string from, string to, Link link)
{
return link.To.Equals(FixPath(to)) && link.From.Equals(FixPath(from));
return link.to.Equals(FixPath(to)) && link.from.Equals(FixPath(from));
}

string FixPath(string path)
Expand Down

0 comments on commit a7d5738

Please sign in to comment.