using System.Collections.Generic;
public static void Main()
var customerCapability = TestFlags.DDC | TestFlags.HOTEL;
AddMessage($"Customer has HOTEL: {customerCapability.HasFlag(TestFlags.HOTEL)}");
AddMessage($"Customer has SALON: {customerCapability.HasFlag(TestFlags.SALON)}");
var allCapabilities = new List<TestFlags>();
foreach(TestFlags flag in Enum.GetValues(typeof(TestFlags)))
if(customerCapability.HasFlag(flag))
allCapabilities.Add(flag);
AddMessage($"Customer has the following capabilities: {string.Join(", ", allCapabilities)}");
public static void AddMessage(string message)
Console.WriteLine(message);