Ejemplo n.º 1
0
        /// <summary>
        /// Creates a new instance.
        /// </summary>
        public GateExtensionsUnitTests()
        {
            UnitTestDataSetLoader <GateDataSet> loader = new UnitTestDataSetLoader <GateDataSet>(new LocalCache(), new UnitTestResourceMonitor());

            UnitTestGateDataSet dataSetOverride = new UnitTestGateDataSet(ResourceNames.Gates, ResourceNames.TestGroups);

            dataSetOverride.Load(new Dictionary <string, IResourceDetails>(2, StringComparer.OrdinalIgnoreCase)
            {
                { ResourceNames.Gates, EmbeddedResources.GetEmbeddedResourceAsResourceDetails(ResourceNames.Gates, GetType()) },
                { ResourceNames.TestGroups, EmbeddedResources.GetEmbeddedResourceAsResourceDetails(ResourceNames.TestGroups, GetType()) }
            });

            loader.OverrideLoadedDataSet(dataSetOverride);

            Gate gate = new Gate("ActiveGate1");

            dataSetOverride.AddGateOverride(gate.Name, gate);

            gate = new Gate("ActiveGate2");
            dataSetOverride.AddGateOverride(gate.Name, gate);

            gate = new Gate("InactiveGate1")
            {
                UserTypes = UserGroupTypes.None
            };
            dataSetOverride.AddGateOverride(gate.Name, gate);

            gate = new Gate("InactiveGate2")
            {
                UserTypes = UserGroupTypes.None
            };
            dataSetOverride.AddGateOverride(gate.Name, gate);
            Gates = new Gates(loader);
        }