forked from dotnet/sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestFolderTests.cs
More file actions
27 lines (20 loc) · 949 Bytes
/
TestFolderTests.cs
File metadata and controls
27 lines (20 loc) · 949 Bytes
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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#nullable disable
using System.Runtime.CompilerServices;
namespace Microsoft.DotNet.Tests;
public class TestFolderTests(ITestOutputHelper log) : SdkTest(log)
{
private const string FailureMessage = """
the test directory was moved from 'src/Tests' to 'test' in main.
Please copy/paste the contents in 'src/Tests' into 'test', delete the 'src/Tests' folder, and commit
""";
[Fact]
public void GivenNoSrcTestsFolder()
{
// https://stackoverflow.com/a/47841442/294804
static string GetThisFolderPath([CallerFilePath] string filePath = null) => Path.GetDirectoryName(filePath);
var srcTestsFolderPath = Path.Combine(GetThisFolderPath(), @"..\..\src\Tests");
Directory.Exists(srcTestsFolderPath).Should().BeFalse(FailureMessage);
}
}