public void Test_CanConfigure_MultipleManagedInstances_NotAlreadyConfigured(int instanceCount)
        {
            StandardConnectionSetup[] managedSetups = new StandardConnectionSetup[instanceCount];

            for (int i = 0; i < instanceCount; i++)
            {
                managedSetups[i] = new StandardConnectionSetup();
            }

            CollectiveConnectionSetup   collectiveSetup = new CollectiveConnectionSetup(managedSetups);
            ConnectionOptionsSourceData sourceData      = GenerateConnectionOptionsData();

            ConfigureSetupWithSourceData(collectiveSetup,
                                         sourceData);

            for (int i = 0; i < instanceCount; i++)
            {
                StandardConnectionSetup managedSetup = managedSetups[i];
                ConnectionOptions       options      = managedSetup
                                                       .BuildOptions();

                AssertConnectionOptionsMatchesSourceData(sourceData,
                                                         options);
            }
        }
예제 #2
0
        public void Test_ConfiguredInstance_CorrectlyBuildsConnectionOptions()
        {
            StandardConnectionSetup     setup      = new StandardConnectionSetup();
            ConnectionOptionsSourceData sourceData = GenerateConnectionOptionsData();

            ConfigureSetupWithSourceData(setup,
                                         sourceData);

            ConnectionOptions options = setup
                                        .BuildOptions();

            AssertConnectionOptionsMatchesSourceData(sourceData,
                                                     options);
        }
        public void Test_CanConfigure_OnlyOneManagedInstance_NotAlreadyConfigured()
        {
            StandardConnectionSetup     managedSetup    = new StandardConnectionSetup();
            CollectiveConnectionSetup   collectiveSetup = new CollectiveConnectionSetup(managedSetup);
            ConnectionOptionsSourceData sourceData      = GenerateConnectionOptionsData();

            ConfigureSetupWithSourceData(collectiveSetup,
                                         sourceData);

            ConnectionOptions options = managedSetup
                                        .BuildOptions();

            AssertConnectionOptionsMatchesSourceData(sourceData,
                                                     options);
        }