public async Task InterfaceInheritPropertyTest() { var source = @" namespace NS1 { public interface IB { Regulus.Remote.Property<int> Property1{get;} Regulus.Remote.Notifier<NS2.IA> Property2{get;} } namespace NS2 { public interface IA : IB { Regulus.Remote.Property<int> Property1{get;} Regulus.Remote.Notifier<NS2.IA> Property2{get;} } } } "; var syntaxBuilder = new Regulus.Remote.Tools.Protocol.Sources.SyntaxTreeBuilder(SourceText.From(source, System.Text.Encoding.UTF8)); await new GhostTest(syntaxBuilder.Tree).RunAsync(); }
public async Task InterfaceInheritEventTest() { var source = @" namespace NS1 { public interface IC { event System.Action<string> Event1; } public interface IB : IC{ event System.Action<string> Event1; } namespace NS2 { public interface IA : IB { event System.Action<string> Event1; } } } "; var syntaxBuilder = new Regulus.Remote.Tools.Protocol.Sources.SyntaxTreeBuilder(SourceText.From(source, System.Text.Encoding.UTF8)); await new GhostTest(syntaxBuilder.Tree).RunAsync(); }
public void InterfacesTest() { var source = @"public interface IA {}"; var syntaxBuilder = new Regulus.Remote.Tools.Protocol.Sources.SyntaxTreeBuilder(SourceText.From(source)); var interfaces = syntaxBuilder.GetInterfaces("IA"); Assert.AreEqual(1, interfaces.Count()); }
public async Task NoNamespaceInterfaceTest() { var source = @" namespace NS1{} public interface IA { } "; var syntaxBuilder = new Regulus.Remote.Tools.Protocol.Sources.SyntaxTreeBuilder(SourceText.From(source, System.Text.Encoding.UTF8)); await new GhostTest(syntaxBuilder.Tree).RunAsync(); }
public async Task InterfaceMethod1ReturnIntTest() { var source = @" namespace NS { public interface IA { Regulus.Remote.Value<bool> Method1(); } } "; var syntaxBuilder = new Regulus.Remote.Tools.Protocol.Sources.SyntaxTreeBuilder(SourceText.From(source, System.Text.Encoding.UTF8)); await new GhostTest(syntaxBuilder.Tree).RunAsync(); }
public async Task InterfacePropertyNotifierTest() { var source = @" public interface IAA { } namespace NS { public interface IA { Regulus.Remote.Notifier<IAA> Property2 {get;} } } "; var syntaxBuilder = new Regulus.Remote.Tools.Protocol.Sources.SyntaxTreeBuilder(SourceText.From(source, System.Text.Encoding.UTF8)); await new GhostTest(syntaxBuilder.Tree).RunAsync(); }
public async Task InterfaceInheritMethodTest() { var source = @" namespace NS1 { public interface IB { void Method1(); } namespace NS2 { public interface IA : IB { void Method1(); } } } "; var syntaxBuilder = new Regulus.Remote.Tools.Protocol.Sources.SyntaxTreeBuilder(SourceText.From(source, System.Text.Encoding.UTF8)); await new GhostTest(syntaxBuilder.Tree).RunAsync(); }