mirror of
https://github.com/AtomUI/AtomUI.git
synced 2026-10-24 02:09:37 +08:00
32 lines
949 B
C#
32 lines
949 B
C#
using AtomUI.Toolkits.GalleryBase.Configuration;
|
|
using AtomUI.Toolkits.GalleryBase.SourceCode;
|
|
using Shouldly;
|
|
using Xunit;
|
|
|
|
namespace AtomUI.Toolkits.GalleryBase.Tests.SourceCode;
|
|
|
|
public class GallerySourceCodeDisplayOptionsTests
|
|
{
|
|
[Fact]
|
|
public void SourceCodeDisplayOptionsKeepProviderAndEnabledState()
|
|
{
|
|
var provider = new EmptySnippetProvider();
|
|
var options = new GalleryBaseOptions();
|
|
|
|
options.SourceCodeDisplay.IsEnabled = true;
|
|
options.SourceCodeDisplay.SnippetProvider = provider;
|
|
|
|
options.SourceCodeDisplay.IsEnabled.ShouldBeTrue();
|
|
options.SourceCodeDisplay.SnippetProvider.ShouldBeSameAs(provider);
|
|
}
|
|
|
|
private sealed class EmptySnippetProvider : IShowCaseCodeSnippetProvider
|
|
{
|
|
public bool TryGetSnippetGroup(ShowCaseCodeSnippetKey key, out ShowCaseCodeSnippetGroup group)
|
|
{
|
|
group = default!;
|
|
return false;
|
|
}
|
|
}
|
|
}
|