Skip to content

Commit 5882ab5

Browse files
committed
C#: Add unit test.
1 parent c85d7e5 commit 5882ab5

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using Xunit;
2+
using Semmle.Util;
3+
using Semmle.Extraction.CSharp;
4+
5+
namespace Semmle.Extraction.Tests
6+
{
7+
public class OverlayTests
8+
{
9+
[Fact]
10+
public void TestOverlay()
11+
{
12+
var logger = new LoggerStub();
13+
var json =
14+
"""
15+
{
16+
"changes": [
17+
"app/controllers/about_controller.xyz",
18+
"app/models/about.xyz"
19+
]
20+
}
21+
""";
22+
var overlay = new OverlayInfo(logger, json);
23+
24+
Assert.True(overlay.IsOverlayMode);
25+
Assert.False(overlay.OnlyMakeScaffold("app/controllers/about_controller.xyz"));
26+
Assert.False(overlay.OnlyMakeScaffold("app/models/about.xyz"));
27+
Assert.True(overlay.OnlyMakeScaffold("app/models/unchanged.xyz"));
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)