public void Test_UseNaming_SingleOverride()
        {
            var mockName = new Mock <IName <DevOpsComponent> >();

            FlexDataConfiguration.NamingMap.Clear();

            FlexDataConfiguration.UseNaming(mockName.Object);

            Assert.AreEqual(FlexDataConfiguration.GetNaming <DevOpsComponent>(), mockName.Object);
        }
Exemple #2
0
        public async Task Test_AzureServiceBusNamespace_ProvisionAll_End2End()
        {
            FlexDataConfiguration.Branch        = "Main";
            FlexDataConfiguration.Configuration = "MO";
            FlexDataConfiguration.UseNaming(new LegacyFctSbNaming());

            using (var client = ManagementClient.CreateServiceBusClient())
                using (var context = new DevOpsFlexDbContext())
                {
                    await context.Components.OfType <AzureServiceBusNamespace>().ProvisionAllAsync(client);
                }
        }
 /// <summary>
 /// Overrides the <see cref="DefaultNaming{T}"/> for a specific <see cref="DevOpsComponent"/>.
 /// </summary>
 /// <typeparam name="T">The type of the <see cref="DevOpsComponent"/> we want to override.</typeparam>
 /// <param name="naming">The <see cref="IName{T}"/> object that will name the overrides.</param>
 public static void UseNaming <T>(IName <T> naming)
     where T : DevOpsComponent
 {
     FlexDataConfiguration.UseNaming(naming);
 }