using System.Linq; using Centron.Host.HelpPage.Metadata; using Centron.Host.Services; using Centron.Tests.EndToEnd.Infrastructure; using Xunit; using Xunit.Abstractions; namespace Centron.Tests.EndToEnd.Tests.WebServiceHelp { public class WebServiceHelpTest : EndToEndTest { public WebServiceHelpTest(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } public override void Execute() { var metadata = WebServiceMetadataFactory.Get(); Assert.NotNull(metadata); Assert.Equal("ICentronRestService", metadata.Name); Assert.NotEmpty(metadata.Methods); // If we validated every web-service method // this test will fail every time we create a new web-service method - annoying // // But I still want to validate, that the WebServiceMetadataFactory works // // We can still validate a couple well-known web-service methods that shouldn't change often this.Verifier.Verify("LoginMethod", metadata.Methods.Single(f => f.Name == "Login")); this.Verifier.Verify("LogoutMethod", metadata.Methods.Single(f => f.Name == "Logout")); } } }