using Centron.Interfaces.Administration.Logins; using CentronSoftware.Centron.WebServices.Interception.Interceptors; using System; using System.Linq; using System.Reflection; using System.ServiceModel.Web; using CentronSoftware.Centron.WebServices.Connections; using Xunit; namespace Centron.Tests.EndToEnd.Tests.ApplicationKinds { public class ApplicationKindTests { [Fact] public void NoDuplicateApplicationKinds() { var duplicates = ApplicationKind.GetAllKinds() .GroupBy(f => f.Id) .Where(f => f.Count() > 1) .ToList(); if (duplicates.Any()) throw new Exception($"There is a duplicate ApplicationKind with the ID {duplicates[0].Key}. This is not allowed, the IDs need to be unique."); } [Fact] public void AuthenticateAttributesThrowNoErrors() { var methods = typeof(ICentronRestService).GetMethods().Where(f => f.GetCustomAttribute() != null); foreach (var method in methods) { var attribute = method.GetCustomAttribute(); if (attribute != null) Assert.NotNull(attribute.Applications); } } } }