-
Notifications
You must be signed in to change notification settings - Fork 103
/
ConsoleOutTests.cs
52 lines (45 loc) · 1.58 KB
/
ConsoleOutTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using NUnit.Framework;
using NUnit.VisualStudio.TestAdapter.Tests.Acceptance.WorkspaceTools;
namespace NUnit.VisualStudio.TestAdapter.Tests.Acceptance;
public sealed class ConsoleOutTests : CsProjAcceptanceTests
{
protected override void AddTestsCs(IsolatedWorkspace workspace)
{
workspace.AddFile("Issue774.cs", @"
using System;
using NUnit.Framework;
namespace Issue774
{
public class ConsoleOutTest
{
[Test]
public void Test1()
{
Console.WriteLine(); // Did not work pre-Issue774 fix
Assert.Pass();
}
[Test]
public void Test2()
{
Console.WriteLine(""Does work"");
Assert.Pass();
}
}
}");
}
protected override string Framework => Frameworks.NetCoreApp31;
[Test, Platform("Win")]
public void DotNetTest()
{
var workspace = Build();
var results = workspace.DotNetTest("", true, true, TestContext.WriteLine);
Verify(2, 2, results);
}
[Test, Platform("Win")]
public void VsTest()
{
var workspace = Build();
var results = workspace.VSTest($@"bin\Debug\{Framework}\Test.dll", VsTestFilter.NoFilter);
Verify(2, 2, results);
}
}