Ejemplo n.º 1
0
        public void Does_Export()
        {
            var exporter      = new ConfigurationExporter();
            var configuration = PizzaConfigurationBuilder.BuildCompleteInstance();
            var output        = exporter.ExportToJson(configuration);

            Assert.IsNotNull(output);
        }
Ejemplo n.º 2
0
        public void A_Complete_Instance_Returns_No_Errors()
        {
            var configuration = PizzaConfigurationBuilder.BuildCompleteInstance();
            var checker       = new ConfigurationRulesChecker();

            List <string> errors;

            checker.Check(configuration, out errors);

            Assert.IsEmpty(errors);
        }
        public void An_Option_Is_UnSet()
        {
            var configuration = PizzaConfigurationBuilder.BuildCompleteInstance();

            var optionsSetter = new ConfigurationItemOptionsSetter();

            var size = configuration.ConfigurationItems.FirstOrDefault(i => i.Name.Equals("Size"));

            Assert.IsNotNull(size);

            var largeOption =
                size.ConfigurationItemOptions.FirstOrDefault(
                    o => o.Name.Equals("Large", StringComparison.OrdinalIgnoreCase));

            Assert.IsNotNull(largeOption);

            Assert.IsTrue(largeOption.IsSelected);

            optionsSetter.SetOrUnSet(configuration.ConfigurationItems, "Size", "Large", false);

            Assert.IsFalse(largeOption.IsSelected);
        }