Fix #745 - allow multiple implements directives
The pass for this was 'break'ing after the first directive for no real reason. Oops.
This commit is contained in:
parent
e1c2efb5ce
commit
3142217bec
|
|
@ -30,7 +30,6 @@ namespace Microsoft.AspNetCore.Blazor.Razor
|
|||
if (token != null)
|
||||
{
|
||||
@class.Interfaces.Add(token.Content);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,6 +58,25 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
frame => AssertFrame.Text(frame, "Hello"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SupportsMultipleImplementsDeclarations()
|
||||
{
|
||||
// Arrange/Act
|
||||
var testInterfaceTypeName = FullTypeName<ITestInterface>();
|
||||
var testInterfaceTypeName2 = FullTypeName<ITestInterface2>();
|
||||
var component = CompileToComponent(
|
||||
$"@implements {testInterfaceTypeName}\n" +
|
||||
$"@implements {testInterfaceTypeName2}\n" +
|
||||
$"Hello");
|
||||
var frames = GetRenderTree(component);
|
||||
|
||||
// Assert
|
||||
Assert.IsAssignableFrom<ITestInterface>(component);
|
||||
Assert.IsAssignableFrom<ITestInterface2>(component);
|
||||
Assert.Collection(frames,
|
||||
frame => AssertFrame.Text(frame, "Hello"));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SupportsInheritsDirective()
|
||||
{
|
||||
|
|
@ -135,6 +154,8 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
|
|||
|
||||
public interface ITestInterface { }
|
||||
|
||||
public interface ITestInterface2 { }
|
||||
|
||||
public class TestBaseClass : BlazorComponent { }
|
||||
|
||||
public interface IMyService1 { }
|
||||
|
|
|
|||
Loading…
Reference in New Issue