Revert "Remove skipped test"
This reverts commit 35fec2b8d7d1a3fd5918738cf01ed4543f4da9ae.
This commit is contained in:
parent
fbe57e2569
commit
0a283cdfdb
|
|
@ -1,7 +1,6 @@
|
||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System;
|
|
||||||
using Microsoft.AspNetCore.Razor.Language;
|
using Microsoft.AspNetCore.Razor.Language;
|
||||||
using Microsoft.AspNetCore.Razor.Language.Intermediate;
|
using Microsoft.AspNetCore.Razor.Language.Intermediate;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
@ -28,6 +27,24 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
|
||||||
Assert.Null(pageDirective);
|
Assert.Null(pageDirective);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void TryGetPageDirective_ReturnsFalse_IfPageDoesStartWithDirective()
|
||||||
|
{
|
||||||
|
// Arrange
|
||||||
|
var content = "Hello @page";
|
||||||
|
var sourceDocument = RazorSourceDocument.Create(content, "file");
|
||||||
|
var codeDocument = RazorCodeDocument.Create(sourceDocument);
|
||||||
|
var engine = CreateEngine();
|
||||||
|
var irDocument = CreateIRDocument(engine, codeDocument);
|
||||||
|
|
||||||
|
// Act
|
||||||
|
var result = PageDirective.TryGetPageDirective(irDocument, out var pageDirective);
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.False(result);
|
||||||
|
Assert.Null(pageDirective);
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void TryGetPageDirective_ReturnsTrue_IfContentHasDirective()
|
public void TryGetPageDirective_ReturnsTrue_IfContentHasDirective()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue