-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathLinkReferenceTests.cs
48 lines (39 loc) · 1.46 KB
/
LinkReferenceTests.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
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
using Elastic.Markdown.IO;
using Elastic.Markdown.IO.Discovery;
using Elastic.Markdown.IO.State;
using FluentAssertions;
namespace Elastic.Markdown.Tests.DocSet;
public class LinkReferenceTests : NavigationTestsBase
{
public LinkReferenceTests(ITestOutputHelper output) : base(output) => Reference = LinkReference.Create(Set);
private LinkReference Reference { get; }
[Fact]
public void ShouldNotBeNull() =>
Reference.Should().NotBeNull();
[Fact]
public void EmitsLinks() =>
Reference.Links.Should().NotBeNullOrEmpty();
[Fact]
public void ShouldNotIncludeSnippets() =>
Reference.Links.Should().NotContain(l => l.Key.Contains("_snippets/"));
}
public class GitCheckoutInformationTests(ITestOutputHelper output) : NavigationTestsBase(output)
{
[Fact]
public void Create()
{
var git = GitCheckoutInformation.Create(ReadFileSystem);
git.Should().NotBeNull();
git!.Branch.Should().NotBeNullOrWhiteSpace();
// this validates we are not returning the test instance as were doing a real read
git.Branch.Should().NotContain(git.Ref);
git.Ref.Should().NotBeNullOrWhiteSpace();
git.Remote.Should().NotBeNullOrWhiteSpace();
git.Remote.Should().NotContain("unknown");
git.RepositoryName.Should().NotContain(".git");
git.Remote.Should().NotContain(".git");
}
}